C++, recall, has the
wchar_t type in addition to
char. And C++11 adds the
char32_t types. It’s possible to create arrays of these types and string literals of these types. C++ uses the
U prefixes, respectively, for string literals of these types. Here’s an example of how they can be used:
wchar_t title = L"Chief Astrogator"; // w_char stringchar16_t name = u"Felonia Ripova"; // char_16 stringchar32_t car = U"Humber Super Snipe"; // char_32 string
C++11 also supports an encoding scheme for Unicode characters called UTF-8. In this scheme a given character may be stored in anywhere from one 8-bit unit, or octet, to four 8-bit units, depending on the numeric value. C++ uses the
u8 prefix ...