
17 Feb
2009
17 Feb
'09
3:57 p.m.
Vladimir Batov wrote:
- std::string <--> std::wstring or similar (based on a future Boost.Unicode library)
I am not sure we can do std::string <-> std::wstring unless we know what std::string represents (currently it can be UTF8 or MBCS). If, with the introduction of std::u8string, std::string is guaranteed to be MBCS, then I guess we can have std::string <-> std::wstring as well.
I think it would be sufficient to rely on the locale to make decisions about the char nature. I have solved this particular task in Boost.Log. You may find it in boost/log/detail/code_conversion.hpp and libs/log/src/code_conversion.cpp, if you're interested.