mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* encoding.c (rb_locale_encoding): defined.
* include/ruby/encoding.h (rb_locale_encoding): declared. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14768 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
6b54d4fd0b
commit
371977ff3d
3 changed files with 19 additions and 0 deletions
|
@ -1,3 +1,9 @@
|
|||
Fri Dec 28 19:11:28 2007 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* encoding.c (rb_locale_encoding): defined.
|
||||
|
||||
* include/ruby/encoding.h (rb_locale_encoding): declared.
|
||||
|
||||
Fri Dec 28 18:45:29 2007 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||
|
||||
* ext/readline/readline.c (readline_readline): set encoding to result.
|
||||
|
|
12
encoding.c
12
encoding.c
|
@ -853,6 +853,18 @@ rb_utf8_encoding(void)
|
|||
return enc_table[ENCINDEX_UTF8].enc;
|
||||
}
|
||||
|
||||
rb_encoding *
|
||||
rb_locale_encoding(void)
|
||||
{
|
||||
VALUE charmap = rb_locale_charmap(rb_cEncoding);
|
||||
int idx = rb_enc_find_index(StringValueCStr(charmap));
|
||||
|
||||
if (idx < 0)
|
||||
return rb_ascii8bit_encoding();
|
||||
|
||||
return rb_enc_from_index(idx);
|
||||
}
|
||||
|
||||
static int default_external_index;
|
||||
|
||||
rb_encoding *
|
||||
|
|
|
@ -123,6 +123,7 @@ int rb_enc_str_asciionly_p(VALUE);
|
|||
VALUE rb_enc_from_encoding(rb_encoding *enc);
|
||||
rb_encoding *rb_ascii8bit_encoding(void);
|
||||
rb_encoding *rb_utf8_encoding(void);
|
||||
rb_encoding *rb_locale_encoding(void);
|
||||
rb_encoding *rb_default_external_encoding(void);
|
||||
VALUE rb_enc_default_external(void);
|
||||
void rb_enc_set_default_external(VALUE encoding);
|
||||
|
|
Loading…
Reference in a new issue