ruby-changes:30445
From: nobu <ko1@a...>
Date: Sun, 11 Aug 2013 23:27:14 +0900 (JST)
Subject: [ruby-changes:30445] nobu:r42524 (trunk): file.c: OSX path encoding
nobu 2013-08-11 23:27:04 +0900 (Sun, 11 Aug 2013) New Revision: 42524 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=42524 Log: file.c: OSX path encoding * file.c (rb_str_encode_ospath): OS path encoding on Mac OS X is also fixed. Modified files: trunk/ChangeLog trunk/file.c trunk/test/ruby/test_require.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 42523) +++ ChangeLog (revision 42524) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Sun Aug 11 23:27:00 2013 Nobuyoshi Nakada <nobu@r...> + + * 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@r...> * test/ruby/test_require.rb (assert_require_nonascii_path): OS path Index: test/ruby/test_require.rb =================================================================== --- test/ruby/test_require.rb (revision 42523) +++ test/ruby/test_require.rb (revision 42524) @@ -76,7 +76,7 @@ class TestRequire < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_require.rb#L76 end case RUBY_PLATFORM - when /cygwin/, /mswin/, /mingw/ + when /cygwin/, /mswin/, /mingw/, /darwin/ def self.ospath_encoding(path) Encoding::UTF_8 end Index: file.c =================================================================== --- file.c (revision 42523) +++ file.c (revision 42524) @@ -239,6 +239,8 @@ rb_str_encode_ospath(VALUE path) https://github.com/ruby/ruby/blob/trunk/file.c#L239 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; } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/