ruby-changes:4082
From: ko1@a...
Date: Fri, 22 Feb 2008 12:17:10 +0900 (JST)
Subject: [ruby-changes:4082] naruse - Ruby:r15572 (trunk): * string.c (rb_str_inspect): string of ascii incompatible encoding
naruse 2008-02-22 12:16:52 +0900 (Fri, 22 Feb 2008)
New Revision: 15572
Modified files:
trunk/ChangeLog
trunk/string.c
Log:
* string.c (rb_str_inspect): string of ascii incompatible encoding
should be escaped and returned as US-ASCII encoding.
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/string.c?r1=15572&r2=15571&diff_format=u
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=15572&r2=15571&diff_format=u
Index: ChangeLog
===================================================================
--- ChangeLog (revision 15571)
+++ ChangeLog (revision 15572)
@@ -1,3 +1,8 @@
+Fri Feb 22 12:11:12 2008 NARUSE, Yui <naruse@r...>
+
+ * string.c (rb_str_inspect): string of ascii incompatible encoding
+ should be escaped and returned as US-ASCII encoding.
+
Fri Feb 22 11:16:55 2008 NARUSE, Yui <naruse@r...>
* string.c (rb_str_substr): copy encoding although empty string.
Index: string.c
===================================================================
--- string.c (revision 15571)
+++ string.c (revision 15572)
@@ -3663,6 +3663,7 @@
char *p, *pend;
VALUE result = rb_str_buf_new2("");
+ if (!rb_enc_asciicompat(enc)) enc = rb_usascii_encoding();
rb_enc_associate(result, enc);
str_cat_char(result, '"', enc);
p = RSTRING_PTR(str); pend = RSTRING_END(str);
--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/