diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-12-09 06:01:41 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-12-09 06:01:41 +0000 |
commit | 8e411664ab7f565ec30718529202e8013e8a3076 (patch) | |
tree | 2d4c0d65fc4333def7687154753dd051cc0a29f1 /file.c | |
parent | 11d85dc1ec5775855cfd4986bd54410389fd1fd1 (diff) |
* file.c (file_path_convert): don't convert it when the path string is
ascii only. [ruby-core:41556] [Bug #5733]
tests are contributed by nobu.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33991 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'file.c')
-rw-r--r-- | file.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -136,8 +136,10 @@ file_path_convert(VALUE name) if (rb_default_internal_encoding() != NULL && rb_usascii_encoding() != fname_encoding && rb_ascii8bit_encoding() != fname_encoding - && (fs_encoding = rb_filesystem_encoding()) != fname_encoding) { + && (fs_encoding = rb_filesystem_encoding()) != fname_encoding + && !rb_enc_str_asciionly_p(name)) { /* Don't call rb_filesystem_encoding() before US-ASCII and ASCII-8BIT */ + /* fs_encoding should be ascii compatible */ name = rb_str_conv_enc(name, fname_encoding, fs_encoding); } #endif |