summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-05 08:44:10 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-05 08:44:10 +0000
commitc123952745ca08effdafe7d71d5010bba1b89d3e (patch)
tree62da3fcdba004096d26f1b371b628b40bc2b3fcc
parente49d229a62a9e9394db8cbd1cd58d8a16b7c9374 (diff)
* 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
-rw-r--r--ChangeLog8
-rw-r--r--encoding.c4
2 files changed, 10 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 31faa2c929..903d63a0d9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
* encoding.c (rb_filesystem_encoding): use ANSI codepage for file
diff --git a/encoding.c b/encoding.c
index fde7103609..f0411d16ee 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