I'm kind of horrified that people actually suggest using UTF-8 inside a std::string and are OK with UTF-16 std::wstring.Do you actually do this? Do you think that it is OK?
Do you think that storing a variable length encoding in std::string or std::wstring is OK and do you do it?
c++
My convention is:std::string = UTF-8.  For general use.Utf16String = UTF-16.  Used mainly for Windows system calls.std::wstring in Windowsstd::basic_string<uint16_t> in LinuxUtf32String = UTF-32.std::basic_string<uint32_t> in Windowsstd::wstring in Linux.std::vector<unsigned char> = non-string binary dataYou just have to get used to thinking of strings as being an array of code points instead of an array of characters.  With this view, all string methods work correctly except for find_first_of/find_last_of/find_first_not_of/find_last_not_of.