[前][次][番号順一覧][スレッド一覧]

ruby-changes:8217

From: naruse <ko1@a...>
Date: Fri, 10 Oct 2008 17:28:37 +0900 (JST)
Subject: [ruby-changes:8217] Ruby:r19745 (trunk): * ext/json/ext/parser/parser.c (JSON_parse_string):

naruse	2008-10-10 17:28:19 +0900 (Fri, 10 Oct 2008)

  New Revision: 19745

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=19745

  Log:
    * ext/json/ext/parser/parser.c (JSON_parse_string):
      associate encoding.

  Modified files:
    trunk/ChangeLog
    trunk/ext/json/ext/parser/parser.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 19744)
+++ ChangeLog	(revision 19745)
@@ -1,3 +1,8 @@
+Fri Oct 10 17:26:50 2008  NARUSE, Yui  <naruse@r...>
+
+	* ext/json/ext/parser/parser.c (JSON_parse_string):
+	  associate encoding.
+
 Fri Oct 10 10:18:21 2008  Ryan Davis  <ryan@w...>
 
 	* lib/test/*: reverted back to test/unit.
Index: ext/json/ext/parser/parser.c
===================================================================
--- ext/json/ext/parser/parser.c	(revision 19744)
+++ ext/json/ext/parser/parser.c	(revision 19745)
@@ -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 @@
 #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;
     }

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]