summaryrefslogtreecommitdiff
path: root/localeinit.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-28 04:27:45 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-28 04:27:45 (GMT)
commit0a946cde01a2cd014027ec628370815e069daaf5 (patch)
treeb0f486a56059fb84a06cc8dc5df286da56a9e9f4 /localeinit.c
parentd85195712da7a02a428c7e68669c1972da2ffcf6 (diff)
localeinit.c: fallback filesystem encoding to UTF-8
* localeinit.c (Init_enc_set_filesystem_encoding): fallback to UTF-8 on Mac OS X, just for convenience sake. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46202 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'localeinit.c')
-rw-r--r--localeinit.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/localeinit.c b/localeinit.c
index 51a06c5..9b28f03 100644
--- a/localeinit.c
+++ b/localeinit.c
@@ -65,6 +65,9 @@ Init_enc_set_filesystem_encoding(void)
if (idx < 0) idx = ENCINDEX_ASCII;
#else
idx = rb_enc_to_index(rb_default_external_encoding());
+# if defined __APPLE__
+ if (idx == rb_usascii_encindex()) idx = rb_utf8_encindex();
+# endif
#endif
return idx;
}