diff options
| -rw-r--r-- | ChangeLog | 4 | ||||
| -rw-r--r-- | io.c | 8 |
2 files changed, 9 insertions, 3 deletions
@@ -1,3 +1,7 @@ +Tue Sep 29 21:16:35 2009 NARUSE, Yui <naruse@ruby-lang.org> + + * io.c (rb_scan_open_args): add UTF8-MAC to no-convertion encoding. + Tue Sep 29 21:21:15 2009 Nobuyoshi Nakada <nobu@ruby-lang.org> * configure.in (--enable-pthread): deprecated. @@ -5307,17 +5307,19 @@ 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 __APPLE__ +#ifdef __APPLE__ { static rb_encoding *fs_encoding; + static rb_encoding *utf8mac_encoding; rb_encoding *fname_encoding = rb_enc_get(fname); if (!fs_encoding) fs_encoding = rb_filesystem_encoding(); + if (!utf8mac_encoding) + utf8mac_encoding = rb_enc_find("UTF8-MAC"); if (rb_usascii_encoding() != fname_encoding && rb_ascii8bit_encoding() != fname_encoding -#if defined __APPLE__ && rb_utf8_encoding() != fname_encoding -#endif + && rb_utf8mac_encoding() != fname_encoding && fs_encoding != fname_encoding) { static VALUE fs_enc; if (!fs_enc) |
