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 | 36783405e85714aad240fa303a60b245e621d6f4 (patch) | |
| tree | c07e729a6f5b3de91b689c604b730f6ccd15aa0f | |
| parent | f49ebbabe230b295eaa441ac96082c1e323fe2ec (diff) | |
| download | ruby-36783405e85714aad240fa303a60b245e621d6f4.tar.gz ruby-36783405e85714aad240fa303a60b245e621d6f4.tar.xz ruby-36783405e85714aad240fa303a60b245e621d6f4.zip | |
* encoding.c (rb_locale_encoding): return US-ASCII when charmap is nil.
git-svn-id: http://svn.ruby-lang.org/repos/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 <naruse@ruby-lang.org> + + * encoding.c (rb_locale_encoding): return US-ASCII when charmap is + nil. + Mon Jan 14 16:12:58 2008 Yukihiro Matsumoto <matz@ruby-lang.org> * lib/shellwords.rb: scape should be an alias to shellescape. a diff --git a/enc/euc_kr.c b/enc/euc_kr.c index 5e586fd0e..a9acd5f96 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 cc3a3648f..ef9d2f14b 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 a7a62e3bb..01677d1b9 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 */ |
