mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
win32: Use UTF-8 as filesystem encoding [Feature #12654]
Co-Authored-By: Dāvis Mosāns <davispuh@gmail.com>
This commit is contained in:
parent
feea436feb
commit
5b98b2ce39
Notes:
git
2020-12-20 18:34:28 +09:00
6 changed files with 37 additions and 59 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue