PDA

View Full Version : German text on the label in Linux



Krish_ng
13th July 2007, 11:44
I hav a label that contains german letters ex: gültig special alphabets....I am reading the
text from a txt file into a QList and setting the label based on the index of the QList.. I am getting all the characters except for special characeters...

patrik08
13th July 2007, 23:02
I hav a label that contains german letters ex: gültig special alphabets....I am reading the
text from a txt file into a QList and setting the label based on the index of the QList.. I am getting all the characters except for special characeters...


Save your file utf-8 format and read it as utf-8... or write string to

QApplication::translate(this, "Isch immer gültig geil öder?", 0, QApplication::UnicodeUTF8));

Or write to xml ...

if nothing play, have a look on linux locale if utf-8 exist?





QTextCodec *codecx;
codecx = QTextCodec::codecForMib(106);
QFile f( fullFileName );
if ( f.open( QFile::WriteOnly | QFile::Text ) )
{
QTextStream sw( &f );
sw.setCodec(codecx);
sw << xml;
f.close();
return true;
}
return false;

Tux-Slack
13th July 2007, 23:20
I had a similar problem.
Maybe this thread will help:
http://www.qtcentre.org/forum/f-newbie-4/t-non-standard-ascii-characters-to-and-from-a-file-8001.html