How to compile utf16 source file?
-
If I used utf16 for sources , I'm getting many errors like stray '\377' in program
-
Qt 5 expects your source code to be encoded in UTF-8.
In Qt 4, you can use "setCodecForCStrings":http://qt-project.org/doc/qt-4.8/qtextcodec.html#setCodecForCStrings and setCodecForLocale (that method is also available in Qt 5).
Apart from Qt, you may also need to make your compiler aware of the unusual encoding.
-
like that:
g++ -finput-charset=CP1251 -fexec-charset=CP1251 -o test my.cppi was trying, and I dropped the case.