From 0a946cde01a2cd014027ec628370815e069daaf5 Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 28 May 2014 04:27:45 +0000 Subject: [PATCH] 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 --- localeinit.c | 3 +++ 1 file changed, 3 insertions(+) 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; }