Hi.
I have all my data in Utf8, but now I have to save a file in Windows1250 code. How to conversion a data from utf8 to windows 1250 and save file in windows 1250 code?
Thaks
Printable View
Hi.
I have all my data in Utf8, but now I have to save a file in Windows1250 code. How to conversion a data from utf8 to windows 1250 and save file in windows 1250 code?
Thaks
Have a look at QTextCodec in combination with QTextStream.
Could you give me an example, there is only examples to and from Unicode :/
Those are the exact examples you need. toUnicode() returns a QString (QStrings are unicode), fromUnicode() returns a QByteArray, which is your target encoding.
Ok, thanks, and what with save file in windows 1250?
Now I have:
Code:
QString fileName = QFileDialog::getSaveFileName(this, tr("Zapisz plik"),numer_fakt+".epp",tr("Pliki wymiany danych (*.epp)")); if(fileName.size()==0) return; return; out.setCodec(codec); out << encodedString; file.close();
what's next? in file I've got only ? ? ? ? sings :/