Results 1 to 3 of 3

Thread: German text on the label in Linux

  1. #1
    Join Date
    Jul 2007
    Posts
    57
    Thanks
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default German text on the label in Linux

    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...

  2. #2
    Join Date
    May 2006
    Posts
    788
    Thanks
    49
    Thanked 48 Times in 46 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: German text on the label in Linux

    Quote Originally Posted by Krish_ng View Post
    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?


    Qt Code:
    1. QTextCodec *codecx;
    2. codecx = QTextCodec::codecForMib(106);
    3. QFile f( fullFileName );
    4. if ( f.open( QFile::WriteOnly | QFile::Text ) )
    5. {
    6. QTextStream sw( &f );
    7. sw.setCodec(codecx);
    8. sw << xml;
    9. f.close();
    10. return true;
    11. }
    12. return false;
    To copy to clipboard, switch view to plain text mode 

  3. The following user says thank you to patrik08 for this useful post:

    Krish_ng (16th July 2007)

  4. #3
    Join Date
    Jul 2007
    Posts
    26
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default Re: German text on the label in Linux

    I had a similar problem.
    Maybe this thread will help:
    http://www.qtcentre.org/forum/f-newb...file-8001.html

  5. The following user says thank you to Tux-Slack for this useful post:

    Krish_ng (16th July 2007)

Similar Threads

  1. Replies: 15
    Last Post: 31st January 2020, 18:25
  2. Unhandled exception in qatomic
    By NewGuy in forum Qt Programming
    Replies: 14
    Last Post: 23rd July 2013, 09:49
  3. Replies: 1
    Last Post: 24th October 2006, 16:40

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.