diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-12-29 02:01:02 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-12-29 02:01:02 +0000 |
commit | 1ebed6c6140a1c3fe0e6b157910cc1d2d1bd49bc (patch) | |
tree | f6ba6e1f4786c0e790a7c3ac0afa091a5d4d33a8 /io.c | |
parent | 1487d9743b6e5082676c194d023b6dabaa53085c (diff) | |
download | ruby-1ebed6c6140a1c3fe0e6b157910cc1d2d1bd49bc.tar.gz |
* file.c (rb_get_path): move encoding conversion of file path
from rb_scan_open_args.
* io.c (rb_scan_open_args): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21146 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 21 |
1 files changed, 1 insertions, 20 deletions
@@ -4885,26 +4885,7 @@ rb_scan_open_args(int argc, VALUE *argv, opt = pop_last_hash(&argc, argv); rb_scan_args(argc, argv, "12", &fname, &vmode, &vperm); FilePathValue(fname); -#if defined _WIN32 || defined __APPLE__ - { - static rb_encoding *fs_encoding; - rb_encoding *fname_encoding = rb_enc_get(fname); - if (!fs_encoding) - fs_encoding = rb_filesystem_encoding(); - if (rb_usascii_encoding() != fname_encoding - && rb_ascii8bit_encoding() != fname_encoding -#if defined __APPLE__ - && rb_utf8_encoding() != fname_encoding -#endif - && fs_encoding != fname_encoding) { - static VALUE fs_enc; - if (!fs_enc) - fs_enc = rb_enc_from_encoding(fs_encoding); - fname = rb_str_encode(fname, fs_enc, 0, Qnil); - } - } -#endif - + rb_io_extract_modeenc(&vmode, &vperm, opt, &oflags, &fmode, convconfig_p); perm = NIL_P(vperm) ? 0666 : NUM2UINT(vperm); |