boost::filesystem -- using non-POSIX locale crashes on Solaris

Hi, I am currently using boost::filesystem::path on Solaris, and I noticed that if I set the locale to anything except "C" or "POSIX" such as "en_US.UTF-8", that it crashes i.e. a run-time error gets thrown. I found a link describing the issue here: https://svn.boost.org/trac/boost/ticket/5928 My question is though, whether it is possible to use boost::filesystem without locales? Meaning, if I know my string is a UTF-8 string, is it possible to avoid the locale processing within the boost filesystem? Thanks, J

I think it is related to this ticket: https://svn.boost.org/trac/boost/ticket/5289 Note: under Solaris, the libstdc++ library does not support any locales besides C and POSIX due to lack to the native OS API. In general there are many locale related design issues in boost::filesystem. Using locale for POSIX OS API when you don't actually use wide API is inherently wrong under POSIX platforms: http://cppcms.com/files/nowide/html/index.html#qna Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/
________________________________ From: JonathonS <thejunkjon@gmail.com> To: boost@lists.boost.org Sent: Sunday, August 26, 2012 4:51 AM Subject: [boost] boost::filesystem -- using non-POSIX locale crashes on Solaris
Hi,
I am currently using boost::filesystem::path on Solaris, and I noticed that if I set the locale to anything except "C" or "POSIX" such as "en_US.UTF-8", that it crashes i.e. a run-time error gets thrown. I found a link describing the issue here: https://svn.boost.org/trac/boost/ticket/5928
My question is though, whether it is possible to use boost::filesystem without locales? Meaning, if I know my string is a UTF-8 string, is it possible to avoid the locale processing within the boost filesystem?
Thanks, J
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

On 26/08/12 19:15, Artyom Beilis wrote:
I think it is related to this ticket:
https://svn.boost.org/trac/boost/ticket/5289
Note: under Solaris, the libstdc++ library does not support any locales besides C and POSIX due to lack to the native OS API.
In general there are many locale related design issues in boost::filesystem.
Using locale for POSIX OS API when you don't actually use wide API is inherently wrong under POSIX platforms:
http://cppcms.com/files/nowide/html/index.html#qna
My question is though, whether it is possible to use boost::filesystem without locales? Meaning, if I know my string is a UTF-8 string, is it possible to avoid the locale processing within the boost filesystem?
Have you tried the Boost.Locale library? It allows Boost.Filesystem to use UTF-8 paths, at least from what I understand. In fact, that's something I need to go pry apart. http://www.boost.org/doc/libs/1_50_0/libs/locale/doc/html/default_encoding_u...
participants (3)
-
Artyom Beilis
-
JonathonS
-
Jookia