ruby-changes:5005
From: ko1@a...
Date: Wed, 21 May 2008 04:21:55 +0900 (JST)
Subject: [ruby-changes:5005] naruse - Ruby:r16498 (trunk): * encoding.c (rb_ascii8bit_encoding): use ENCINDEX_ASCII.
naruse 2008-05-21 04:21:26 +0900 (Wed, 21 May 2008) New Revision: 16498 Modified files: trunk/ChangeLog trunk/encoding.c trunk/include/ruby/encoding.h Log: * encoding.c (rb_ascii8bit_encoding): use ENCINDEX_ASCII. * encoding.c, include/ruby/encoding.h (rb_ascii8bit_encindex): added. * encoding.c (rb_locale_encoding): use rb_usascii_encoding(). http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=16498&r2=16497&diff_format=u http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/include/ruby/encoding.h?r1=16498&r2=16497&diff_format=u http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/encoding.c?r1=16498&r2=16497&diff_format=u Index: encoding.c =================================================================== --- encoding.c (revision 16497) +++ encoding.c (revision 16498) @@ -912,9 +912,15 @@ if (!enc_table.list) { rb_enc_init(); } - return enc_table.list[0].enc; + return enc_table.list[ENCINDEX_ASCII].enc; } +int +rb_ascii8bit_encindex(void) +{ + return ENCINDEX_ASCII; +} + rb_encoding * rb_utf8_encoding(void) { @@ -946,7 +952,7 @@ int idx; if (NIL_P(charmap)) - idx = rb_enc_find_index("US-ASCII"); + return rb_usascii_encoding(); else idx = rb_enc_find_index(StringValueCStr(charmap)); if (idx < 0) Index: include/ruby/encoding.h =================================================================== --- include/ruby/encoding.h (revision 16497) +++ include/ruby/encoding.h (revision 16498) @@ -171,6 +171,7 @@ rb_encoding *rb_locale_encoding(void); rb_encoding *rb_default_external_encoding(void); int rb_usascii_encindex(void); +int rb_ascii8bit_encindex(void); VALUE rb_enc_default_external(void); void rb_enc_set_default_external(VALUE encoding); VALUE rb_locale_charmap(VALUE klass); Index: ChangeLog =================================================================== --- ChangeLog (revision 16497) +++ ChangeLog (revision 16498) @@ -1,3 +1,12 @@ +Wed May 21 04:20:20 2008 NARUSE, Yui <naruse@r...> + + * encoding.c (rb_ascii8bit_encoding): use ENCINDEX_ASCII. + + * encoding.c, include/ruby/encoding.h (rb_ascii8bit_encindex): + added. + + * encoding.c (rb_locale_encoding): use rb_usascii_encoding(). + Wed May 21 01:45:58 2008 NAKAMURA Usaku <usa@r...> * test/ruby/test_file_exhaustive.rb (setup): workaround for Windows -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/