diff options
author | Florian Frank <flori@ping.de> | 2011-07-08 16:29:21 +0200 |
---|---|---|
committer | Florian Frank <flori@ping.de> | 2011-07-08 16:32:06 +0200 |
commit | f7f78896607b6f6226cdee4ae76de922d4583d32 (patch) | |
tree | fb8b18ce241984a125d881c29fd317a007358bd9 /ext/json/ext/parser/parser.rl | |
parent | dcfa15b6a1179a29d4ee7b3ff16807fa9b1f96a4 (diff) | |
parent | 24f84d63beef15eafd2e59df3d809f1928774d00 (diff) | |
download | ruby-json-f7f78896607b6f6226cdee4ae76de922d4583d32.tar.gz |
Merge branch 'master' of https://github.com/nobu/json into development
Conflicts: ext/json/ext/parser/parser.c
Diffstat (limited to 'ext/json/ext/parser/parser.rl')
-rw-r--r-- | ext/json/ext/parser/parser.rl | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/json/ext/parser/parser.rl b/ext/json/ext/parser/parser.rl index b18f06f..21b445e 100644 --- a/ext/json/ext/parser/parser.rl +++ b/ext/json/ext/parser/parser.rl @@ -120,9 +120,9 @@ static ID i_json_creatable_p, i_json_create, i_create_id, i_create_additions, fhold; fbreak; } else { if (NIL_P(json->object_class)) { - rb_hash_aset(*result, last_name, v); + rb_hash_aset(*result, last_name, v); } else { - rb_funcall(*result, i_aset, 2, last_name, v); + rb_funcall(*result, i_aset, 2, last_name, v); } fexec np; } @@ -581,6 +581,7 @@ static VALUE convert_encoding(VALUE source) } else if (len >= 4 && ptr[1] == 0 && ptr[3] == 0) { source = rb_funcall(source, i_encode, 2, CEncoding_UTF_8, CEncoding_UTF_16LE); } else { + source = rb_str_dup(source); FORCE_UTF8(source); } } else { |