summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-01 21:53:14 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-01 21:53:14 +0000
commit9bd77cfd7734955a4e85479fb1482085f49aaba5 (patch)
treee798d9f2b27985f63a23e020731034e0fbf1c9ac
parent845103b751fe79f22e2d31b08e3ed21de1987535 (diff)
* 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--encoding.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index f1a7f47..52811c0 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 21:27:55 2009 Tanaka Akira <akr@fsij.org>
* ext/socket/raddrinfo.c (addrinfo_ipv4_private_p): new method.
diff --git a/encoding.c b/encoding.c
index 337942b..4afee36 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");