A C++ UCS-2 string class?
Does anyone know if there's a UCS-2 string class for C++ somewhere, under a commercially-viable license, that fits the concept of basic_string? I've been using ICU for a while, but now I need a basic_string compatible class, not the java-like UnicodeString. I don't need UTF-16, mere UCS-2 would be good.
TIA
If you're using MSVC, wchar_t defaults to a 2-byte data type. So you can use std::wstring to suit your needs. Otherwise, you can provide your own template of basic_string with whatever sized datatype you want.
I need it to be portable, and IIRC the unicode standard advices againsusing wchar_t. I doubt basic_string<uint16> would do :D.
Depending on what exactly you mean by "UCS-2 string class", basic_string<uint16> may indeed work.
i.e., if all you need is a container for 16-bit codepoints with the standard string operators then it work fine.
i.e., if all you need is a container for 16-bit codepoints with the standard string operators then it work fine.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement