PDA

View Full Version : QString unicode



ramin.lich
24th April 2015, 22:32
i read in Qt docs about QString and found that QString supports unicode encoding but still when i write some stances in text file i see some "?" between words.
the language that i use is part of unicode here this is my code.


QFile dataF("fa.txt");
dataF.open(QIODevice::WriteOnly | QIODevice::Append);
QTextStream streamF(&dataF);
streamF<<fa<<"\r\n";
dataF.close();

im i miss something?
best regards

wysota
24th April 2015, 23:01
im i miss something?
You didn't tell Qt how to encode your data. See QTextStream::setCodec().