diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | localeinit.c | 4 |
2 files changed, 8 insertions, 1 deletions
@@ -1,3 +1,8 @@ +Sun Jun 19 15:01:18 2016 Martin Duerst <[email protected]> + + * localeinit.c: Fix filesystem encoding for cygwin to UTF-8 (see + https://cygwin.com/cygwin-ug-net/using-specialnames.html#pathnames-unusual) + Sun Jun 19 14:31:07 2016 Kazuki Yamaguchi <[email protected]> * ext/openssl/ossl_pkey.h, ext/openssl/ossl_pkey_dh.c, diff --git a/localeinit.c b/localeinit.c index 6563a6f90a..605e3bd148 100644 --- a/localeinit.c +++ b/localeinit.c @@ -100,11 +100,13 @@ Init_enc_set_filesystem_encoding(void) int idx; #if defined NO_LOCALE_CHARMAP # error NO_LOCALE_CHARMAP defined -#elif defined _WIN32 || defined __CYGWIN__ +#elif defined _WIN32 char cp[SIZEOF_CP_NAME]; CP_FORMAT(cp, AreFileApisANSI() ? GetACP() : GetOEMCP()); idx = rb_enc_find_index(cp); if (idx < 0) idx = ENCINDEX_ASCII; +#elif defined __CYGWIN__ + idx = ENCINDEX_UTF_8; #else idx = rb_enc_to_index(rb_default_external_encoding()); #endif |