Sunday, 15 May 2011

c++ - Assign a literal to an std::u16string or to an std::u32string -



c++ - Assign a literal to an std::u16string or to an std::u32string -

as know may assign string literal value as:

std::string s="good"; std::wstring s=l"good";

how assign

std::u16string s= std::u32string s=

you can read c++ string literals here.

in particular utf-16 literals prefix lowercase u:

u16string s = u"...";

and utf-32 literals prefix uppercase u:

u32string s = u"...";

c++ c++11

No comments:

Post a Comment