diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-01-14 09:08:45 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-01-14 09:08:45 +0000 |
commit | 0605d15f6aeb776a0699a49fdb761ae1e9a40d6e (patch) | |
tree | c07e729a6f5b3de91b689c604b730f6ccd15aa0f | |
parent | d407e2fac82c643654f2d647243ae9a1e538505a (diff) |
* encoding.c (rb_locale_encoding): return US-ASCII when charmap is nil.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15039 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | enc/euc_kr.c | 2 | ||||
-rw-r--r-- | enc/euc_tw.c | 1 | ||||
-rw-r--r-- | encoding.c | 8 |
4 files changed, 12 insertions, 4 deletions
@@ -1,3 +1,8 @@ +Mon Jan 14 18:06:37 2008 NARUSE, Yui <[email protected]> + + * encoding.c (rb_locale_encoding): return US-ASCII when charmap is + nil. + Mon Jan 14 16:12:58 2008 Yukihiro Matsumoto <[email protected]> * lib/shellwords.rb: scape should be an alias to shellescape. a diff --git a/enc/euc_kr.c b/enc/euc_kr.c index 5e586fd0eb..a9acd5f963 100644 --- a/enc/euc_kr.c +++ b/enc/euc_kr.c @@ -138,5 +138,7 @@ OnigEncodingDefine(euc_kr, EUC_KR) = { euckr_left_adjust_char_head, euckr_is_allowed_reverse_match }; +ENC_ALIAS("eucKR", "EUC-KR"); ENC_REPLICATE("EUC-CN", "EUC-KR"); +ENC_ALIAS("eucCN", "EUC-CN"); ENC_REPLICATE("CP949", "EUC-KR"); diff --git a/enc/euc_tw.c b/enc/euc_tw.c index cc3a3648f1..ef9d2f14bc 100644 --- a/enc/euc_tw.c +++ b/enc/euc_tw.c @@ -138,3 +138,4 @@ OnigEncodingDefine(euc_tw, EUC_TW) = { euctw_left_adjust_char_head, euctw_is_allowed_reverse_match }; +ENC_ALIAS("eucTW", "EUC-TW"); diff --git a/encoding.c b/encoding.c index a7a62e3bb3..01677d1b92 100644 --- a/encoding.c +++ b/encoding.c @@ -874,9 +874,9 @@ rb_locale_encoding(void) int idx; if (NIL_P(charmap)) - return rb_ascii8bit_encoding(); - - idx = rb_enc_find_index(StringValueCStr(charmap)); + idx = rb_enc_find_index("US-ASCII"); + else + idx = rb_enc_find_index(StringValueCStr(charmap)); if (idx < 0) return rb_ascii8bit_encoding(); @@ -1093,7 +1093,7 @@ Init_Encoding(void) rb_define_dummy_encoding("ISO-2022-JP"); rb_enc_alias("ISO2022-JP", "ISO-2022-JP"); rb_define_dummy_encoding("ISO-2022-JP-2"); - rb_enc_alias("ISO2022-JP-2", "ISO-2022-JP-2"); + rb_enc_alias("ISO2022-JP2", "ISO-2022-JP-2"); } /* locale insensitive functions */ |