The advantage is the codec ... if you like save file to utf8Originally Posted by sreedhar
QTextCodec *codecutf8 = QTextCodec::codecForMib(106);
or latin
QTextCodec *codeclatin1 = QTextCodec::codecForMib(4);
QTextStream in(&data);
in.setAutoDetectUnicode(false);
in.setCodec(codecutf8);
default go all to latin iso depend on os config....
if you save xml file and other apps like this file on utf8
to read a a utf8 file qt cann not autodetect tahs file is utf8 and destroy the file dual utf8 convert!
to read file ..... if a utf8
if (file.open(QFile::ReadOnly | QFile::Text)) {
inside = QString::fromUtf8(file.readAll());
file.close();
}
Bookmarks