C++11 introduces a new set of string literal prefixes (and even allows user-defined suffixes). On top of this, you can directly use Unicode escape sequences to code a certain symbol without having to worry about encoding.
const char16_t* s16 = u"\u00DA";
const char32_t* s32 = U"\u00DA";
But can I use the unicode escape sequences in wchar_t
string literals as well? It would seem to be a defect if this wasn't possible.
const wchar_t* sw = L"\u00DA";
The integer value of sw[0]
would of course depend on what wchar_t
is on a particular platform, but to all other effects, this should be portable, no?