i use
QChar('影').unicode();
compiler
Warning: multi-byte character constant
how to get chinese's unicode ?
i use
QChar('影').unicode();
compiler
Warning: multi-byte character constant
how to get chinese's unicode ?
Either use utf-8 or check the unicode value of the glyph you want to encode and provide it in decimal or hexadecimal form - there is a QChar constructor variant taking two uints.
Setting a codec won't help. You are using multibyte characters in your source code and the compiler doesn't like it. You should only use singlebyte characters in sourcecodes regardless of the language you use.
since QChar is multi-byte, shouldnt it be ok to give it a multi-byte unicode value? and even if compiler gives a warning..shouldnt the guy be able to get the chinese unicode?
It's not about QChar. It's about the CPP preprocessor or C++ compiler that issues the warning. QChar can accept unicode characters but you have to give them as two separate 8 bit parts. This is incorrect according to C++ standard: 'aa' (two characters in single quotes) and that's exactly what he is passing.
Bookmarks