summaryrefslogtreecommitdiff
path: root/encoding.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-09-29 00:34:00 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-09-29 00:34:00 +0000
commitf7554133b2dd050585f0714cc2729edf6d9291f9 (patch)
treec5453df4387fbdfd2e9c0b3802df6ac12ad54b65 /encoding.c
parent5d6696c90959600927e229c3b3fd3f9ffb9444d7 (diff)
* encoding.c (rb_enc_unicode_p): defined.
Returns 1 when the encoding is Unicode series other than UTF-7 else 0. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25142 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'encoding.c')
-rw-r--r--encoding.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/encoding.c b/encoding.c
index c8fa8ee5ed..9886556e93 100644
--- a/encoding.c
+++ b/encoding.c
@@ -393,6 +393,15 @@ enc_ascii_compatible_p(VALUE enc)
return rb_enc_asciicompat(enc_table.list[must_encoding(enc)].enc) ? Qtrue : Qfalse;
}
+/*
+ * Returns 1 when the encoding is Unicode series other than UTF-7 else 0.
+ */
+int
+rb_enc_unicode_p(rb_encoding *enc)
+{
+ return rb_utf8_encoding()->is_code_ctype == enc->is_code_ctype;
+}
+
static const char *
enc_alias_internal(const char *alias, int idx)
{