ruby-changes:13372
From: naruse <ko1@a...>
Date: Tue, 29 Sep 2009 09:34:18 +0900 (JST)
Subject: [ruby-changes:13372] Ruby:r25142 (trunk): * encoding.c (rb_enc_unicode_p): defined.
naruse 2009-09-29 09:34:00 +0900 (Tue, 29 Sep 2009) New Revision: 25142 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=25142 Log: * encoding.c (rb_enc_unicode_p): defined. Returns 1 when the encoding is Unicode series other than UTF-7 else 0. Modified files: trunk/ChangeLog trunk/encoding.c trunk/include/ruby/encoding.h Index: encoding.c =================================================================== --- encoding.c (revision 25141) +++ encoding.c (revision 25142) @@ -393,6 +393,15 @@ 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) { Index: include/ruby/encoding.h =================================================================== --- include/ruby/encoding.h (revision 25141) +++ include/ruby/encoding.h (revision 25142) @@ -176,6 +176,7 @@ int rb_enc_str_asciionly_p(VALUE); #define rb_enc_str_asciicompat_p(str) rb_enc_asciicompat(rb_enc_get(str)) VALUE rb_enc_from_encoding(rb_encoding *enc); +int rb_enc_unicode_p(rb_encoding *enc); rb_encoding *rb_ascii8bit_encoding(void); rb_encoding *rb_utf8_encoding(void); rb_encoding *rb_usascii_encoding(void); Index: ChangeLog =================================================================== --- ChangeLog (revision 25141) +++ ChangeLog (revision 25142) @@ -1,3 +1,9 @@ +Tue Sep 29 06:49:16 2009 NARUSE, Yui <naruse@r...> + + * encoding.c (rb_enc_unicode_p): defined. + Returns 1 when the encoding is Unicode series + other than UTF-7 else 0. + Tue Sep 29 04:14:08 2009 NARUSE, Yui <naruse@r...> * encoding.c (rb_filesystem_encoding): On Unix systems, -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/