hi,
i have written an app, that is able to output the SQLite-DBs content to an SQL-File and also read this.
As all the text in the database is in german where we have Umlaute (special characters like ä) i am getting problems with reading of the SQL-File. Qt seems to expect the file to be UTF. If i convert the file to UTF with my texteditor it works, otherwise i will see garbage instead of my Umlaute.
I am writing the file with
-----
QTextStream out(&file);
out.setGenerateByteOrderMark (true);
out << content;
------
(the second line is new: i am trying to make sure i write UTF, but it doesn't work ;(
i read the file with:
-------
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
QMessageBox::critical(this,tr("Datei konnte nicht geöffnet werden"),tr("Das Öffnen der Datei ist fehlgeschlagen:\n")+fileName);
return;
}
QTextStream in(&file);
--------
From my trial with setGenerateByteOrderMark it seems that now the textfiles i produce look like UTF, but aren't. So either i need a second method for QTextStream to make it really produce UTF or i need something to enable reading of ANSI-Text.
Bookmarks