summaryrefslogtreecommitdiff
path: root/localeinit.c
diff options
context:
space:
mode:
Diffstat (limited to 'localeinit.c')
-rw-r--r--localeinit.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/localeinit.c b/localeinit.c
index bec29a6d46..bbcbac832e 100644
--- a/localeinit.c
+++ b/localeinit.c
@@ -123,8 +123,9 @@ Init_enc_set_filesystem_encoding(void)
idx = ENCINDEX_US_ASCII;
#elif defined _WIN32
char cp[SIZEOF_CP_NAME];
- const UINT codepage = ruby_w32_codepage[1] ? ruby_w32_codepage[1] :
- AreFileApisANSI() ? GetACP() : GetOEMCP();
+ const UINT codepage = ruby_w32_codepage[1];
+ if (!codepage) return ENCINDEX_UTF_8;
+ /* for debugging */
CP_FORMAT(cp, codepage);
idx = rb_enc_find_index(cp);
if (idx < 0) idx = ENCINDEX_ASCII;