diff --git a/ChangeLog b/ChangeLog index 0cf6d71c3c..b92611f157 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri Oct 10 17:26:50 2008 NARUSE, Yui + + * ext/json/ext/parser/parser.c (JSON_parse_string): + associate encoding. + Fri Oct 10 10:18:21 2008 Ryan Davis * lib/test/*: reverted back to test/unit. diff --git a/ext/json/ext/parser/parser.c b/ext/json/ext/parser/parser.c index fe85b26cee..9de618d0e6 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; }