summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-08-11 14:27:04 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-08-11 14:27:04 +0000
commit863989993a44e7a80b083065da194ca10e277321 (patch)
tree7bc21d8d30660a346025de1b1584b44a95b023c6
parent7cb53ed363159c26e6fdd40d42b683bc1b5707d1 (diff)
file.c: OSX path encoding
* file.c (rb_str_encode_ospath): OS path encoding on Mac OS X is also fixed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42524 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--file.c2
-rw-r--r--test/ruby/test_require.rb2
3 files changed, 8 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index cd59025..955db23 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sun Aug 11 23:27:00 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * file.c (rb_str_encode_ospath): OS path encoding on Mac OS X is also
+ fixed.
+
Sun Aug 11 22:57:24 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
* test/ruby/test_require.rb (assert_require_nonascii_path): OS path
diff --git a/file.c b/file.c
index a6b5566..02143a1 100644
--- a/file.c
+++ b/file.c
@@ -239,6 +239,8 @@ rb_str_encode_ospath(VALUE path)
if (enc != utf8) {
path = rb_str_conv_enc(path, enc, utf8);
}
+#elif defined __APPLE__
+ path = rb_str_conv_enc(path, NULL, rb_utf8_encoding());
#endif
return path;
}
diff --git a/test/ruby/test_require.rb b/test/ruby/test_require.rb
index 42479e7..34c5fde 100644
--- a/test/ruby/test_require.rb
+++ b/test/ruby/test_require.rb
@@ -76,7 +76,7 @@ class TestRequire < Test::Unit::TestCase
end
case RUBY_PLATFORM
- when /cygwin/, /mswin/, /mingw/
+ when /cygwin/, /mswin/, /mingw/, /darwin/
def self.ospath_encoding(path)
Encoding::UTF_8
end