summaryrefslogtreecommitdiff
path: root/localeinit.c
diff options
context:
space:
mode:
authorduerst <duerst@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-06-19 06:01:25 (GMT)
committerduerst <duerst@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-06-19 06:01:25 (GMT)
commitd282efbeff498f2abaeb3f748a812251e76e39c4 (patch)
tree858049a504105503d1191a81acdd2d31660e01f5 /localeinit.c
parent31388c4a73fa4280b1e544648b35faf02ff4c2e2 (diff)
* localeinit.c: Fix filesystem encoding for cygwin to UTF-8 (see
https://cygwin.com/cygwin-ug-net/using-specialnames.html#pathnames-unusual) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55451 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'localeinit.c')
-rw-r--r--localeinit.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/localeinit.c b/localeinit.c
index 6563a6f..605e3bd 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