ruby-changes:8527
From: yugui <ko1@a...>
Date: Thu, 30 Oct 2008 21:11:10 +0900 (JST)
Subject: [ruby-changes:8527] Ruby:r20061 (ruby_1_9_1): merges r20052 from trunk into ruby_1_9_1.
yugui 2008-10-30 21:09:58 +0900 (Thu, 30 Oct 2008) New Revision: 20061 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=20061 Log: merges r20052 from trunk into ruby_1_9_1. * encoding.c (rb_locale_encoding): makes an alias for locale. [ruby-dev:36976] * encoding.c (rb_enc_set_default_external): ditto for external. * encoding.c (rb_enc_set_default_internal): ditto for internal. Modified files: branches/ruby_1_9_1/ChangeLog branches/ruby_1_9_1/encoding.c Index: ruby_1_9_1/encoding.c =================================================================== --- ruby_1_9_1/encoding.c (revision 20060) +++ ruby_1_9_1/encoding.c (revision 20061) @@ -996,12 +996,12 @@ int idx; if (NIL_P(charmap)) - return rb_usascii_encoding(); - else - idx = rb_enc_find_index(StringValueCStr(charmap)); - if (idx < 0) - return rb_ascii8bit_encoding(); + idx = rb_usascii_encindex(); + else if ((idx = rb_enc_find_index(StringValueCStr(charmap))) < 0) + idx = rb_ascii8bit_encindex(); + if (rb_enc_registered("locale") < 0) enc_alias("locale", idx); + return rb_enc_from_index(idx); } @@ -1057,6 +1057,7 @@ { default_external_index = rb_enc_to_index(rb_to_encoding(encoding)); default_external = 0; + enc_alias("external", default_external_index); } /* -2 => not yet set, -1 => nil */ @@ -1106,6 +1107,7 @@ if (default_internal_index == rb_usascii_encindex()) default_internal_index = rb_utf8_encindex(); default_internal = 0; + enc_alias("internal", default_internal_index); } /* Index: ruby_1_9_1/ChangeLog =================================================================== --- ruby_1_9_1/ChangeLog (revision 20060) +++ ruby_1_9_1/ChangeLog (revision 20061) @@ -1,3 +1,12 @@ +Thu Oct 30 09:31:45 2008 Nobuyoshi Nakada <nobu@r...> + + * encoding.c (rb_locale_encoding): makes an alias for locale. + [ruby-dev:36976] + + * encoding.c (rb_enc_set_default_external): ditto for external. + + * encoding.c (rb_enc_set_default_internal): ditto for internal. + Thu Oct 30 02:20:33 2008 Yusuke Endoh <mame@t...> * array.c (rb_ary_sort_bang): remove SEGV when replacing array with -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/