U"" literal for hardcoded literals in std::u32string issue

43 Views Asked by At

I want to quickly make "alert" animation draft with cocos2dx with Unicode symbols involved.

I'm using MSVS on Windows 11, cocos2dx 3.17, using std::u32string to store symbols.

My source file is encoded with codepage 65001 (UTF8 without signature).

I noticed I see some glitchy symbols that I don't use. For example:

std::u32string test = U"Ö";

test will contain "Ö".

Further investigation gave me this result:

// bug - "Ö" on screen and debug view
std::u32string u32TextBlankB = U"Ö";
// Ok - "Ö" on screen and debug view
std::u32string u32TextBlank = U"\x000000D6";

I have no clue why it works like this. Is it a compiler bug, or a misunderstanding of the concept?

0

There are 0 best solutions below