summaryrefslogtreecommitdiff
path: root/encoding.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-06-05 17:56:55 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-06-05 17:56:55 +0000
commitfce00b2422f53681f827335f384b4f053342f93d (patch)
treef33e19c4ea26053bd4dae7a23ce193768179cca8 /encoding.c
parent09e9807a8972353040e7b9933bd8e8cd35b11eb5 (diff)
merge revision(s) 28103:
* 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/branches/ruby_1_9_2@28181 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'encoding.c')
-rw-r--r--encoding.c3
1 files changed, 2 insertions, 1 deletions
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 *