summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--encoding.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 22ef594cc0..6a522000c2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Mon Feb 2 06:51:36 2009 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * encoding.c (rb_filesystem_encoding): Windows' filesystem encoding is
+ sometimes ANSI code page and sometimes OEM code page. we should check
+ whether code page is used.
+
Sun Feb 1 05:19:43 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* variable.c (rb_const_get_0), vm_insnhelper.c (vm_get_ev_const):
diff --git a/encoding.c b/encoding.c
index 337942bf74..4afee36ff3 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", GetOEMCP());
+ snprintf(cp, sizeof cp, "CP%d", AreFileApisANSI() ? GetACP() : GetOEMCP());
enc = rb_enc_find(cp);
#elif defined __APPLE__
enc = rb_enc_find("UTF8-MAC");