I am trying to convert an application from Java + Swing to C ++ + Qt. At some point, I had to deal with some Unicode intermediates. In Java, this was pretty simple:
private static String[] hiraganaTable = {
"\u3042", "\u3044", "\u3046", "\u3048", "\u304a",
"\u304b", "\u304d", "\u304f", "\u3051", "\u3053",
...
}
... whereas in C ++ I have problems:
QString hiraganaTable[] = {
"\x30\x42", "\x30\x44", "\x30\x46", "\x30\x48", "\x30\x4a",
"\x30\x4b", "\x30\x4d", "\x30\x4f", "\x30\x51", "\x30\x53",
...
};
I could not use \ u in VS2008 because I got a bunch of form warnings:
represented by the universal symbol name '\ u3042' cannot be represented on the current code page (1250)
And do not call me stupid, I tried to use File-> Advanced Save Options, but nothing has changed, the code page has not changed at all. This seems to be a known issue: How to create a UTF-8 string literal in Visual C ++ 2008
, , , Vim \x30\x42. , QStrings . . fromAscii(), fromUtf8(), fromLocal8Bit(), QString (QByteArray), . , U + 3042 , , , "E3 81 82" . QString:: fromAscii(). , "U +" "U + 3042" ( 0xE38182 - 0x3042 = E35140, , Unicode?). , UTF-8?