[filesystem] how to get wstring value from wpath::external_file_string() with gcc?
I want wpath::external_file_string to return a unicode wstring. On windows, with my visual studio project settings set to "Unicode character set", it correctly returns a wstring. But on OSX (using xcode/gcc) it tries to return a string. I believe this is due to Traits::external_string_type. This is supposed to be OS specific string type and I want my application to use Unicode for all interactions with OS (filesystem paths, command-line parameters etc), then boost will also set this type to wstring. How do I configure my project such that this trait is set to wstring? Any xcode settings or gcc parameters or #defines? SG
On Wed, Feb 10, 2010 at 4:16 PM, Igor R
On windows, with my visual studio project settings set to "Unicode character set", it correctly returns a wstring. But on OSX (using xcode/gcc) it tries to return a string.
Maybe OSX uses UTF-8 unicode, that's why you get std::string?
You are right that default application tries to use UTF-8 unicode to communicate with OS, I want to make it use wide-character. Visual Studio provides an option to choose this for windows, I am just not familiar enough with OSX/xcode. The real problem is that wpath::external_file_string() fails on osx. It throws an exception trying to convert from wchar_t to char saying 'invalid argument'. And I can't track down why. SG
participants (2)
-
Igor R
-
Sachin Garg