diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-01-15 04:10:16 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-01-15 04:10:16 +0000 |
| commit | 125f24d094c7aec126225858eb11799c7c4785fa (patch) | |
| tree | c8b37c4eff2aee9bb91ed7fa70d9a280f18b2c54 /encoding.c | |
| parent | c955acc19cbc8b58f6aa0236cb677831199a3767 (diff) | |
| download | ruby-125f24d094c7aec126225858eb11799c7c4785fa.tar.gz ruby-125f24d094c7aec126225858eb11799c7c4785fa.tar.xz ruby-125f24d094c7aec126225858eb11799c7c4785fa.zip | |
* configure.in, win32/Makefile.sub (MISSING): added langinfo on mingw
and mswin.
* encoding.c (rb_locale_charmap): use environments on mingw and mswin.
* missing/langinfo.c (nl_langinfo_codeset): MS-Windows Japanese
environment uses Windows-31J derived from Shift_JIS, not EUC-JP.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21517 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'encoding.c')
| -rw-r--r-- | encoding.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/encoding.c b/encoding.c index 858f4e70e..2abd0b1f1 100644 --- a/encoding.c +++ b/encoding.c @@ -1218,7 +1218,7 @@ rb_locale_charmap(VALUE klass) { #if defined NO_LOCALE_CHARMAP return rb_usascii_str_new2("ASCII-8BIT"); -#elif defined __CYGWIN__ +#elif defined _WIN32 || defined __CYGWIN__ const char *nl_langinfo_codeset(void); const char *codeset = nl_langinfo_codeset(); char cp[sizeof(int) * 3 + 4]; @@ -1231,8 +1231,6 @@ rb_locale_charmap(VALUE klass) char *codeset; codeset = nl_langinfo(CODESET); return rb_usascii_str_new2(codeset); -#elif defined _WIN32 - return rb_sprintf("CP%d", GetConsoleCP()); #else return Qnil; #endif |
