summaryrefslogtreecommitdiffstats
path: root/encoding.c
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-09 02:18:40 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-09 02:18:40 +0000
commit4a6cfaff7aef1bdbf7455c5029124e463d0bfe41 (patch)
treeeeed83badcba38b3579c913d11b43e7724e2c875 /encoding.c
parentfa736e3d833fbf066d0f3c4af112331605fb3be0 (diff)
merges r21342 from trunk into ruby_1_9_1.
* 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: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@21401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'encoding.c')
-rw-r--r--encoding.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/encoding.c b/encoding.c
index fde710360..f0411d16e 100644
--- a/encoding.c
+++ b/encoding.c
@@ -1034,7 +1034,7 @@ rb_filesystem_encoding(void)
enc = rb_default_external_encoding();
#elif defined _WIN32 || defined __CYGWIN__
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);
#elif defined __APPLE__
enc = rb_enc_find("UTF8-MAC");
@@ -1218,7 +1218,7 @@ rb_locale_charmap(VALUE klass)
codeset = nl_langinfo(CODESET);
return rb_usascii_str_new2(codeset);
#elif defined _WIN32
- return rb_sprintf("CP%d", GetACP());
+ return rb_sprintf("CP%d", GetConsoleCP());
#else
return Qnil;
#endif