
29 Jan
2011
29 Jan
'11
10:25 a.m.
If std::string is UTF-8 encoded (as you are suggesting, correct?), then you also requires additional copy:
// conversion for Windows API std::string u8s = ...; std::wstring u16s = convert_to_utf16(u8s); HANDLE h = CreateFileW(u16s.c_str(), ...);
Regards, Anders Dalvander
Fortunately only under Windows, under rest of the normal OSes it would not require :-). Also the idea is also to have utf-8 aware API in boost for windows so you just call: boost::ofstream file(utf_name); Artyom