TextStream special characters
-
if a line (string) of my file contains a special character, it will be written as a odd code into a new file. how to fix it?
@
QString line = pathInput.readLine(); // line == "hi. chi è? ügo de gerò"
QTextStream out(pathOut);
out << line; // hi. chi A̴ (for example...)
@EDIT: please use @-tags for code highlighting, gerolf
-
Set the proper encodings for incoming and outgoing files. Have a look at "QTextStream::setCodec()":http://doc.trolltech.com/latest/qtextstream.html#setCodec.