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

ruby-changes:16143

From: naruse <ko1@a...>
Date: Mon, 31 May 2010 14:47:13 +0900 (JST)
Subject: [ruby-changes:16143] Ruby:r28103 (trunk): * encoding.c (rb_enc_unicode_p): check the encoding is Unicode

naruse	2010-05-31 14:46:58 +0900 (Mon, 31 May 2010)

  New Revision: 28103

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

  Log:
    * encoding.c (rb_enc_unicode_p): check the encoding is Unicode
      or not by the name; not function's pointer. [ruby-dev:41479]

  Modified files:
    trunk/ChangeLog
    trunk/encoding.c

Index: encoding.c
===================================================================
--- encoding.c	(revision 28102)
+++ encoding.c	(revision 28103)
@@ -420,7 +420,8 @@
 int
 rb_enc_unicode_p(rb_encoding *enc)
 {
-    return rb_utf8_encoding()->is_code_ctype == enc->is_code_ctype;
+    const char *name = rb_enc_name(enc);
+    return name[0] == 'U' && name[1] == 'T' && name[2] == 'F' && name[4] != '7';
 }
 
 static const char *
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 28102)
+++ ChangeLog	(revision 28103)
@@ -1,3 +1,8 @@
+Mon May 31 13:44:40 2010  NARUSE, Yui  <naruse@r...>
+
+	* encoding.c (rb_enc_unicode_p): check the encoding is Unicode
+	  or not by the name; not function's pointer. [ruby-dev:41479]
+
 Mon May 31 04:03:43 2010  Nobuyoshi Nakada  <nobu@r...>
 
 	* file.c (file_expand_path): check if expanded dname encoding is

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

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