4 ms·
I'm just reaching the end of a pretty soul-destroying consulting project. The client side is C++, and uses a lot of strings. To my horror, there still doesn't s
by pmjordan 17y ago
I'm just reaching the end of a pretty soul-destroying consulting project. The client side is C++, and uses a lot of strings. To my horror, there still doesn't seem to be a de-facto standard way of dealing with the various unicode encodings in C++, even after my multi-year C++ hiatus. I ended up using the WideCharToMultiByte() and MultiByteToWideChar() Win32 functions, which are rather yucky. I'd fully expected boost to have an answer to this problem by now, but that only offers UCS-4 <-> UTF-8 conversion.
What libraries do C and C++ programmers use to hold unicode strings and convert between encodings these days?
- ximeng 17y agoNot quite answering your question, but worth noting that C++0x supports various unicode encodings for string literals: http://en.wikipedia.org/wiki/C%2B%2B0x#New_string_literals http://en.wikipedia.org/wiki/C%2B%2B0x#New_string_literals There's also a link to a proposed boost solution here: http://stackoverflow.com/questions/511280/is-there-stl-and-utf8-friendly-c-wrapper-for-icu-or-other-powerful-unicode-lib http://stackoverflow.com/questions/511280/is-there-stl-and-u... Doesn't quite sound like the standard way that you're looking for, but moving closer. Edit: "ICU today is de-facto standard Unicode/localization library" from a mailing discussion of the boost solution. And http://art-blog.no-ip.info/cppcms/blog/post/43 http://art-blog.no-ip.info/cppcms/blog/post/43 has an interesting comparison of a few libraries, but not too comprehensive.