From 8a144fdedc2df7ee87e21ad805fcbcbd18209533 Mon Sep 17 00:00:00 2001
From: naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>
Date: Sat, 6 Mar 2010 17:11:28 +0000
Subject: [PATCH] * 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
---
 ChangeLog  |  9 +++++++++
 encoding.c |  2 --
 file.c     | 11 -----------
 3 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 35f4be3d0c..e56eafaa89 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
diff --git a/encoding.c b/encoding.c
index 6b7c5a5c20..b7258ddbc0 100644
--- a/encoding.c
+++ b/encoding.c
@@ -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
diff --git a/file.c b/file.c
index 5ca3793cbd..7aca492c65 100644
--- a/file.c
+++ b/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;
 }