diff options
Diffstat (limited to 'ext/json/parser/parser.rl')
-rw-r--r-- | ext/json/parser/parser.rl | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/ext/json/parser/parser.rl b/ext/json/parser/parser.rl index abd056f18c..07319a8fd7 100644 --- a/ext/json/parser/parser.rl +++ b/ext/json/parser/parser.rl @@ -549,6 +549,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 { |