
On Sun, 14 Jun 2009 21:41:16 +0200, Robert Dailey
[...]Great advice Zach. I'll definitely do this. However, it would be nice to have an already-made conversion routine for UTF8 to UTF16. I'm hoping
The conversion routines you are looking for are std::mbsrtowcs() and std::wcsrtombs() in <cwchar>. You must set the global locale first before you use them so they know which multi-byte encoding they should use (try for example "en_US.UTF-8"). If you want your application to work on Windows, too, you can't use those functions unfortunately but must use MultiByteToWideChar() and WideCharToMultiByte() instead (as there is no UTF-8 locale on Windows). The Unicode FAQ for Unix and Linux might also help: http://www.cl.cam.ac.uk/~mgk25/unicode.html Boris