From 5b98b2ce39ed979aec614365a2dc3e1c30052bca Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sun, 20 Dec 2020 02:16:31 +0900 Subject: win32: Use UTF-8 as filesystem encoding [Feature #12654] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Dāvis Mosāns --- localeinit.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'localeinit.c') 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; -- cgit v1.2.1