diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-28 10:41:52 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-28 10:41:52 +0000 |
commit | eb1014e4aeb30b9ba18686d4c955cad7e0372108 (patch) | |
tree | ad6c02a087ecc6805fb34ca6120e475e291b150e /encoding.c | |
parent | b1b238da2c20e2312e1e802960feeda6b94b1ca5 (diff) | |
download | ruby-eb1014e4aeb30b9ba18686d4c955cad7e0372108.tar.gz |
* encoding.c (rb_locale_encoding): should check return value from
rb_locale_charmap().
* ruby.c (locale_encoding): removed.
* ruby.c (process_options): use rb_locale_encoding() instead of
locale_encoding().
* ext/readline/readline.c (readline_readline): use locale encoding
instead of input IO's encoding. [ruby-dev:32872]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14770 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'encoding.c')
-rw-r--r-- | encoding.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/encoding.c b/encoding.c index adbad670f1..ac47b9c157 100644 --- a/encoding.c +++ b/encoding.c @@ -857,8 +857,12 @@ rb_encoding * rb_locale_encoding(void) { VALUE charmap = rb_locale_charmap(rb_cEncoding); - int idx = rb_enc_find_index(StringValueCStr(charmap)); + int idx; + + if (NIL_P(charmap)) + return rb_ascii8bit_encoding(); + idx = rb_enc_find_index(StringValueCStr(charmap)); if (idx < 0) return rb_ascii8bit_encoding(); |