Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r59695 - trunk/libs/filesystem/src
From: bdawes_at_[hidden]
Date: 2010-02-15 16:23:05


Author: bemandawes
Date: 2010-02-15 16:23:05 EST (Mon, 15 Feb 2010)
New Revision: 59695
URL: http://svn.boost.org/trac/boost/changeset/59695

Log:
Fix #3928
Text files modified:
   trunk/libs/filesystem/src/path.cpp | 13 +++++++++++--
   1 files changed, 11 insertions(+), 2 deletions(-)

Modified: trunk/libs/filesystem/src/path.cpp
==============================================================================
--- trunk/libs/filesystem/src/path.cpp (original)
+++ trunk/libs/filesystem/src/path.cpp 2010-02-15 16:23:05 EST (Mon, 15 Feb 2010)
@@ -26,6 +26,11 @@
 
 #include <cwchar> // for std::mbstate_t
 
+#if defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__)
+# include "utf8_codecvt_facet.hpp"
+#endif
+
+
 namespace
 {
   // std::locale construction can throw (if LC_MESSAGES is wrong, for example),
@@ -37,8 +42,12 @@
 #if !defined(macintosh) && !defined(__APPLE__) && !defined(__APPLE_CC__)
     // ISO C calls this "the locale-specific native environment":
     static std::locale lc("");
-#else
- static std::locale lc = std::locale(); // Mac OS doesn't support locale("")
+#else // Mac OS
+ // "All BSD system functions expect their string parameters to be in UTF-8 encoding
+ // and nothing else."
+ // See http://developer.apple.com/mac/library/documentation/MacOSX/Conceptual/BPInternational/Articles/FileEncodings.html
+ std::locale global_loc = std::locale(); // Mac OS doesn't support locale("")
+ static std::locale lc(global_loc, new fs::detail::utf8_codecvt_facet);
 #endif
     return lc;
   }


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk