Currently I'm messing about with Boost.Locale, I'm intending to use it for my project, but I don't know how to do something along the lines of specifying the external encoding (usually the user's locale, en_US.UTF-8 in my case), and the internal coding of my program (UTF-16), to have input and output converted, possibly using a codecvt. A possible example would be translating UTF-16-≥POSIX UTF-8 paths, or UTF-8-≥Windows UTF-16 paths.
I assume you use Windows and wide characters. It is enough to imbue the locale to the output **wide** stream and write to it. boost::locale::generator gen; // stdout std::wcout.imbue(gen("")); std::wcout << L"שלום" << std::endl; // UTF-8 file I/O std::wfstream stream; stream.imbue(gen("")); stream.open(name,std::wfstream::out); stream << L"שלום" << std::endl; Would actually output the text in narrow encoding. Also there is an example how to create custom wide streams that would convert wide to narrow encoding http://svn.boost.org/svn/boost/trunk/libs/locale/doc/html/charset_handling.h... Also for converting things like path UTF-8/UTF-16 you can use utf_to_utf functions that work just on chunks of text. http://svn.boost.org/svn/boost/trunk/libs/locale/doc/html/group__codepage.ht... Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.sf.net/ CppDB - C++ SQL Connectivity: http://cppcms.sf.net/sql/cppdb/