Is there an STL string class that properly handles Unicode?

Goz picture Goz · Feb 1, 2011 · Viewed 7.5k times · Source

I know all about std::string and std::wstring but they don't seem to fully pay attention to extended character encoding of UTF-8 and UTF-16 (On windows at least). There is also no support for UTF-32.

So does anyone know of cross-platform drop-in replacement classes that provide full UTF-8, UTF-16 and UTF-32 support?

Answer

Jon Purdy picture Jon Purdy · Feb 1, 2011

And let's not forget the lightweight, very user-friendly, header-only UTF-8 library UTF8-CPP. Not a drop-in replacement, but can easily be used in conjunction with std::string and has no external dependencies.