diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-10-10 08:28:19 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-10-10 08:28:19 +0000 |
commit | 6a90df3bafc06ad9cd9d5862738cc162419228fb (patch) | |
tree | 11fd576884d12d2a219906b2237c1585dea400f8 | |
parent | d1997d215f5875abd6fb0f30ee9ad2cd84f97547 (diff) | |
download | ruby-6a90df3bafc06ad9cd9d5862738cc162419228fb.tar.gz ruby-6a90df3bafc06ad9cd9d5862738cc162419228fb.tar.xz ruby-6a90df3bafc06ad9cd9d5862738cc162419228fb.zip |
* ext/json/ext/parser/parser.c (JSON_parse_string):
associate encoding.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19745 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | ext/json/ext/parser/parser.c | 4 |
2 files changed, 8 insertions, 1 deletions
@@ -1,3 +1,8 @@ +Fri Oct 10 17:26:50 2008 NARUSE, Yui <naruse@ruby-lang.org> + + * ext/json/ext/parser/parser.c (JSON_parse_string): + associate encoding. + Fri Oct 10 10:18:21 2008 Ryan Davis <ryan@wrath.local> * lib/test/*: reverted back to test/unit. diff --git a/ext/json/ext/parser/parser.c b/ext/json/ext/parser/parser.c index fe85b26ce..9de618d0e 100644 --- a/ext/json/ext/parser/parser.c +++ b/ext/json/ext/parser/parser.c @@ -1,5 +1,6 @@ #line 1 "parser.rl" #include "ruby.h" +#include "ruby/encoding.h" #include "unicode.h" #define EVIL 0x666 @@ -1405,7 +1406,8 @@ case 7: #line 411 "parser.rl" if (cs >= JSON_string_first_final) { - return p + 1; + rb_enc_associate(*result, rb_utf8_encoding()); + return p + 1; } else { return NULL; } |