diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-05-31 05:46:58 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-05-31 05:46:58 +0000 |
commit | d13e191d2593093f3c34a2cb6778d8676ca54d6f (patch) | |
tree | bb8d4ed0d27c8b5bdfeea2e590dabfe80c9dc897 | |
parent | b5cd43c998038156ecf5fc28e5138b7f88b9aafe (diff) |
* encoding.c (rb_enc_unicode_p): check the encoding is Unicode
or not by the name; not function's pointer. [ruby-dev:41479]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28103 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | encoding.c | 3 |
2 files changed, 7 insertions, 1 deletions
@@ -1,3 +1,8 @@ +Mon May 31 13:44:40 2010 NARUSE, Yui <naruse@ruby-lang.org> + + * 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@ruby-lang.org> * file.c (file_expand_path): check if expanded dname encoding is diff --git a/encoding.c b/encoding.c index 83607d5103..a7950a8251 100644 --- a/encoding.c +++ b/encoding.c @@ -420,7 +420,8 @@ enc_ascii_compatible_p(VALUE enc) 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 * |