From eb1014e4aeb30b9ba18686d4c955cad7e0372108 Mon Sep 17 00:00:00 2001 From: usa Date: Fri, 28 Dec 2007 10:41:52 +0000 Subject: * 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 --- ruby.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) (limited to 'ruby.c') diff --git a/ruby.c b/ruby.c index 94aba59008..d345ec9c86 100644 --- a/ruby.c +++ b/ruby.c @@ -135,23 +135,6 @@ usage(const char *name) printf(" %s\n", *p++); } -static rb_encoding * -locale_encoding(void) -{ - VALUE codeset = rb_locale_charmap(Qnil); - char *name; - int idx; - - if (codeset == Qnil) - return rb_ascii8bit_encoding(); - - name = StringValueCStr(codeset); - idx = rb_enc_find_index(name); - if (idx < 0) - return rb_ascii8bit_encoding(); - return rb_enc_from_index(idx); -} - extern VALUE rb_load_path; #ifndef CharNext /* defined as CharNext[AW] on Windows. */ @@ -1025,7 +1008,7 @@ process_options(VALUE arg) enc = rb_enc_from_index(opt->enc_index); } else { - enc = locale_encoding(); + enc = rb_locale_encoding(); } rb_enc_set_default_external(rb_enc_from_encoding(enc)); -- cgit v1.2.3