1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
naruse 2009-09-29 00:34:00 +00:00
parent 5d6696c909
commit f7554133b2
3 changed files with 16 additions and 0 deletions

View file

@ -1,3 +1,9 @@
Tue Sep 29 06:49:16 2009 NARUSE, Yui <naruse@ruby-lang.org>
* 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@ruby-lang.org> Tue Sep 29 04:14:08 2009 NARUSE, Yui <naruse@ruby-lang.org>
* encoding.c (rb_filesystem_encoding): On Unix systems, * encoding.c (rb_filesystem_encoding): On Unix systems,

View file

@ -393,6 +393,15 @@ enc_ascii_compatible_p(VALUE enc)
return rb_enc_asciicompat(enc_table.list[must_encoding(enc)].enc) ? Qtrue : Qfalse; 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 * static const char *
enc_alias_internal(const char *alias, int idx) enc_alias_internal(const char *alias, int idx)
{ {

View file

@ -176,6 +176,7 @@ long rb_str_coderange_scan_restartable(const char*, const char*, rb_encoding*, i
int rb_enc_str_asciionly_p(VALUE); int rb_enc_str_asciionly_p(VALUE);
#define rb_enc_str_asciicompat_p(str) rb_enc_asciicompat(rb_enc_get(str)) #define rb_enc_str_asciicompat_p(str) rb_enc_asciicompat(rb_enc_get(str))
VALUE rb_enc_from_encoding(rb_encoding *enc); 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_ascii8bit_encoding(void);
rb_encoding *rb_utf8_encoding(void); rb_encoding *rb_utf8_encoding(void);
rb_encoding *rb_usascii_encoding(void); rb_encoding *rb_usascii_encoding(void);