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

* 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().

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16498 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2008-05-20 19:21:26 +00:00
parent 1de486b600
commit 13f20ccda7
3 changed files with 18 additions and 2 deletions

View file

@ -1,3 +1,12 @@
Wed May 21 04:20:20 2008 NARUSE, Yui <naruse@ruby-lang.org>
* 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@ruby-lang.org>
* test/ruby/test_file_exhaustive.rb (setup): workaround for Windows

View file

@ -912,7 +912,13 @@ rb_ascii8bit_encoding(void)
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 *
@ -946,7 +952,7 @@ rb_locale_encoding(void)
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)

View file

@ -171,6 +171,7 @@ rb_encoding *rb_usascii_encoding(void);
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);