mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* encoding.c (rb_locale_charmap): use GetConsoleCP() instead of
GetACP() because external encoding should be console's one. * encoding.c (rb_filesystem_encoding): use GetOEMCP() instead of GetACP() because VFAT/FAT32 uses OEM CP. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21342 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e49d229a62
commit
c123952745
2 changed files with 10 additions and 2 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
Mon Jan 5 17:38:40 2009 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
|
* encoding.c (rb_locale_charmap): use GetConsoleCP() instead of
|
||||||
|
GetACP() because external encoding should be console's one.
|
||||||
|
|
||||||
|
* encoding.c (rb_filesystem_encoding): use GetOEMCP() instead of
|
||||||
|
GetACP() because VFAT/FAT32 uses OEM CP.
|
||||||
|
|
||||||
Mon Jan 5 16:26:48 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Mon Jan 5 16:26:48 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* encoding.c (rb_filesystem_encoding): use ANSI codepage for file
|
* encoding.c (rb_filesystem_encoding): use ANSI codepage for file
|
||||||
|
|
|
@ -1034,7 +1034,7 @@ rb_filesystem_encoding(void)
|
||||||
enc = rb_default_external_encoding();
|
enc = rb_default_external_encoding();
|
||||||
#elif defined _WIN32 || defined __CYGWIN__
|
#elif defined _WIN32 || defined __CYGWIN__
|
||||||
char cp[sizeof(int) * 8 / 3 + 4];
|
char cp[sizeof(int) * 8 / 3 + 4];
|
||||||
snprintf(cp, sizeof cp, "CP%d", GetACP());
|
snprintf(cp, sizeof cp, "CP%d", GetOEMCP());
|
||||||
enc = rb_enc_find(cp);
|
enc = rb_enc_find(cp);
|
||||||
#elif defined __APPLE__
|
#elif defined __APPLE__
|
||||||
enc = rb_enc_find("UTF8-MAC");
|
enc = rb_enc_find("UTF8-MAC");
|
||||||
|
@ -1218,7 +1218,7 @@ rb_locale_charmap(VALUE klass)
|
||||||
codeset = nl_langinfo(CODESET);
|
codeset = nl_langinfo(CODESET);
|
||||||
return rb_usascii_str_new2(codeset);
|
return rb_usascii_str_new2(codeset);
|
||||||
#elif defined _WIN32
|
#elif defined _WIN32
|
||||||
return rb_sprintf("CP%d", GetACP());
|
return rb_sprintf("CP%d", GetConsoleCP());
|
||||||
#else
|
#else
|
||||||
return Qnil;
|
return Qnil;
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue