summaryrefslogtreecommitdiff
path: root/ext/json
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-10 08:28:19 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-10 08:28:19 +0000
commit5b35f2c13788786af6813fbd9fa5db59c545ae32 (patch)
tree11fd576884d12d2a219906b2237c1585dea400f8 /ext/json
parentc71e65e92fa2bec30390554eaa5cf2e74973919f (diff)
* ext/json/ext/parser/parser.c (JSON_parse_string):
associate encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19745 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/json')
-rw-r--r--ext/json/ext/parser/parser.c4
1 files changed, 3 insertions, 1 deletions
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;
}