Results 1 to 3 of 3

Thread: Japanese Text

  1. #1
    Join Date
    Jan 2006
    Posts
    75
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Japanese Text

    I'm not seeing Japanese text properly displayed when I compile this simple code. What am I forgetting?

    Qt Code:
    1. #include <QtGui/QApplication>
    2. #include <QMessageBox>
    3.  
    4. int main(int argc, char *argv[])
    5. {
    6. QApplication a(argc, argv);
    7. QMessageBox::critical(0, "わたし", "私", QMessageBox::Cancel);
    8. }
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Japanese Text

    Qt Code:
    1. QMessageBox::critical(0, QString::fromUtf8("わたし"), QString::fromUtf8("私"), QMessageBox::Cancel);
    To copy to clipboard, switch view to plain text mode 
    Or for internationalizing use trUtf8("xyz").

    EDIT: or fromUtf16, don't know wich encoding japanese text has.

  3. The following 2 users say thank you to Lykurg for this useful post:

    AaronMK (5th October 2010), kroenecker (19th April 2009)

  4. #3
    Join Date
    Jan 2006
    Posts
    75
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Japanese Text

    Lykurg you rock!

Similar Threads

  1. Unhandled exception in qatomic
    By NewGuy in forum Qt Programming
    Replies: 14
    Last Post: 23rd July 2013, 09:49
  2. Replies: 0
    Last Post: 10th April 2009, 15:28
  3. Match the text beetween two string
    By dreamer in forum Qt Programming
    Replies: 4
    Last Post: 20th May 2008, 14:48
  4. QTextEdit slow to insert text
    By thomaspu in forum Qt Programming
    Replies: 4
    Last Post: 10th January 2008, 12:05
  5. Editable text in QGraphicsView
    By wysota in forum Qt Programming
    Replies: 8
    Last Post: 24th February 2007, 15:30

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.