LoadFile and SaveFile now work with boost::filesystem::path which adds support for unicode filenames on windows. It is even possible to work with utf8 filenames by imbueing an utf8-locale on boost::filesystem::path. This patch is for version 2.6.1.
I guess your patch may be enchanced. When you write:
TIXML_STRING filename( _filename.string() );
I guess that's dangerous because this implies a conversion with default "codecvt()", which may be whatever the user imbued in boost::filesystem. Actually for my apps, I imbue an UTF8 locale so that .string() returns UTF8, but what if it converts a path to a given code page ? For instance, if I got arabic or chinese characters and my codepage is Latin1, then I'll loose characters! The path becomes invalid.
I guess this needs testing, but what about converting with a defined codec? Or maybe forcing string/wstring depending on the system would work (I sincerely don't know)?
Cheers,
Sukender
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
patch for tinyxml.cpp/h
Hi Jochen,
I guess your patch may be enchanced. When you write:
TIXML_STRING filename( _filename.string() );
I guess that's dangerous because this implies a conversion with default "codecvt()", which may be whatever the user imbued in boost::filesystem. Actually for my apps, I imbue an UTF8 locale so that .string() returns UTF8, but what if it converts a path to a given code page ? For instance, if I got arabic or chinese characters and my codepage is Latin1, then I'll loose characters! The path becomes invalid.
I guess this needs testing, but what about converting with a defined codec? Or maybe forcing string/wstring depending on the system would work (I sincerely don't know)?
Cheers,
Sukender