summaryrefslogtreecommitdiff
path: root/ruby.c
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-28 10:41:52 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-28 10:41:52 +0000
commiteb1014e4aeb30b9ba18686d4c955cad7e0372108 (patch)
treead6c02a087ecc6805fb34ca6120e475e291b150e /ruby.c
parentb1b238da2c20e2312e1e802960feeda6b94b1ca5 (diff)
* 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 'ruby.c')
-rw-r--r--ruby.c19
1 files changed, 1 insertions, 18 deletions
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));