Unsolved Encoding problem with polish chars
-
Hi ,
lately I started to face strange problem:
For e.g.:
If I pass polish characters to combobox everything is ok and they are correctly displayed,
but if I try to print them with qDebug() or save to file I get something like:
qDebug() << "option oneąęŻŹ";
console output: option oneaeZZAny idea how to fix that?
-
@Kaluss qDebug: this is probably just an issue with the font used in your console.
Writing to file: how do you write the strings into the file. -
Hi,
QFile file("someFile.txt"); if(file.open(QIODevice::WriteOnly | QIOdevice::Text)) { QTextSTream out(&file); out << "option oneąęŻŹ"; file.close(); }
-
@Kaluss You can try to set codec, see http://doc.qt.io/qt-5/qtextstream.html#setCodec
-
@Kaluss said in Encoding problem with polish chars:
out << "option oneąęŻŹ";
What about this:
out << QString::fromUtf8("option oneąęŻŹ");
-
It's quite strange.
It's saved normally when I set the codec QTextStream::setCodec("UTF-8"), but till now I didn't have to do that.
Maybe Windows after update changed something in configuration.Does somone know how to enable those chars in Qt console?