diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-08-01 03:16:30 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-08-01 03:16:30 +0000 |
commit | 4b209e1baae576f7a409ffc13cf79b7c57e0b2fa (patch) | |
tree | d1e76221fdae585d92abb0b0987dff855c780390 /ext/json/parser/parser.rl | |
parent | 572778357337db459888d9a9f69ab91063b9c68f (diff) | |
download | ruby-4b209e1baae576f7a409ffc13cf79b7c57e0b2fa.tar.gz |
* ext/json/*, test/json/json_parser_test.rb: Update json-2.0.2.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/json/parser/parser.rl')
-rw-r--r-- | ext/json/parser/parser.rl | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/json/parser/parser.rl b/ext/json/parser/parser.rl index c67634b8ba..dd24cf94cc 100644 --- a/ext/json/parser/parser.rl +++ b/ext/json/parser/parser.rl @@ -565,6 +565,9 @@ static VALUE convert_encoding(VALUE source) #ifdef HAVE_RUBY_ENCODING_H rb_encoding *enc = rb_enc_get(source); if (enc == rb_ascii8bit_encoding()) { + if (OBJ_FROZEN(source)) { + source = rb_str_dup(source); + } FORCE_UTF8(source); } else { source = rb_str_conv_enc(source, NULL, rb_utf8_encoding()); |