Reputation: 2592
As I know I may assign to a string a literal value as:
std::string s="good"; std::wstring s=L"good";
how do I assign to a
std::u16string s= std::u32string s=
Upvotes: 13
Views: 5064
Reputation: 6647
You can read about the C++ string literals here.
In particular for UTF-16 literals you prefix with a lowercase u:
u16string s = u"...";
And for UTF-32 literals you prefix with a uppercase U:
u32string s = U"...";
Upvotes: 26