mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* encoding.c (enc_set_filesystem_encoding):
filesystem encoding on Mac OS X is now default external encoding. so Mac OS X is now treated as one of Unix. [ruby-dev:40439] * file.c (file_path_convert): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26832 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
f6a23214da
commit
8a144fdedc
3 changed files with 9 additions and 13 deletions
|
@ -1,3 +1,12 @@
|
|||
Sun Mar 7 02:05:38 2010 NARUSE, Yui <naruse@ruby-lang.org>
|
||||
|
||||
* encoding.c (enc_set_filesystem_encoding):
|
||||
filesystem encoding on Mac OS X is now
|
||||
default external encoding. so Mac OS X is now
|
||||
treated as one of Unix. [ruby-dev:40439]
|
||||
|
||||
* file.c (file_path_convert): ditto.
|
||||
|
||||
Sat Mar 6 22:07:09 2010 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* pack.c: fix the prototype of rb_big2ulong_pack.
|
||||
|
|
|
@ -1147,8 +1147,6 @@ enc_set_filesystem_encoding(void)
|
|||
snprintf(cp, sizeof cp, "CP%d", AreFileApisANSI() ? GetACP() : GetOEMCP());
|
||||
idx = rb_enc_find_index(cp);
|
||||
if (idx < 0) idx = rb_ascii8bit_encindex();
|
||||
#elif defined __APPLE__
|
||||
idx = rb_utf8_encindex();
|
||||
#else
|
||||
idx = rb_enc_to_index(rb_default_external_encoding());
|
||||
#endif
|
||||
|
|
11
file.c
11
file.c
|
@ -109,16 +109,6 @@ file_path_convert(VALUE name)
|
|||
#ifndef _WIN32 /* non Windows == Unix */
|
||||
rb_encoding *fname_encoding = rb_enc_from_index(ENCODING_GET(name));
|
||||
rb_encoding *fs_encoding;
|
||||
# ifdef __APPLE__
|
||||
/* Mac OS X's file system encoding is UTF-8 */
|
||||
if (rb_usascii_encoding() != fname_encoding
|
||||
&& rb_ascii8bit_encoding() != fname_encoding
|
||||
&& (fs_encoding = rb_filesystem_encoding()) != fname_encoding
|
||||
&& rb_enc_find("UTF8-MAC") != fname_encoding) {
|
||||
/* Don't call rb_enc_find() before UTF-8 */
|
||||
name = rb_str_conv_enc(name, fname_encoding, fs_encoding);
|
||||
}
|
||||
# else /* Unix other than Mac OS X */
|
||||
if (rb_default_internal_encoding() != NULL
|
||||
&& rb_usascii_encoding() != fname_encoding
|
||||
&& rb_ascii8bit_encoding() != fname_encoding
|
||||
|
@ -126,7 +116,6 @@ file_path_convert(VALUE name)
|
|||
/* Don't call rb_filesystem_encoding() before US-ASCII and ASCII-8BIT */
|
||||
name = rb_str_conv_enc(name, fname_encoding, fs_encoding);
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
return name;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue