diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-05-28 04:27:45 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-05-28 04:27:45 +0000 |
commit | 0a946cde01a2cd014027ec628370815e069daaf5 (patch) | |
tree | b0f486a56059fb84a06cc8dc5df286da56a9e9f4 /localeinit.c | |
parent | d85195712da7a02a428c7e68669c1972da2ffcf6 (diff) | |
download | ruby-0a946cde01a2cd014027ec628370815e069daaf5.tar.gz |
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.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/localeinit.c b/localeinit.c index 51a06c5b1c..9b28f03380 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; } |