From: Baptiste L. <bap...@gm...> - 2010-04-21 16:22:33
|
2010/4/21 <ma...@al...> > [...] > > > Should we add asWString() and asCWString() ? If so should they return the > string encoded in utf-16 or utf-32 on platforms where wchar_t is 32 bits? > The string that was passed at initialization? Or should we makes encoding > explicit: asUTF16WString(), asUTF32WString()? Concerning the last options, > as UTF32 would not be possible on platforms where wchar_t is 2 bytes, this > would introduce portability issues... > Yep, better to have asWString() and asCWString(), and they always should > return string encoded in utf-16. > > What is your rational for always returning string encoded in utf-16? I'm afraid that if we do so on a system where wchar_t is encoded using utf-32, the resulting string would not be compatible with system w* API, such as towlower... listed in part here: http://www.unix.org/version2/whatsnew/login_mse.html. |