Results 1 to 2 of 2

Thread: Problem with Vietnamese Characters

  1. #1
    Join Date
    Nov 2011
    Posts
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Problem with Vietnamese Characters

    Hi All,

    I have QFile with name having Vietnamese Characters "Cộng hòa xã hội.rar".
    To pass file name to libcurl I need filename in const char* format.
    Below is the code to do the same:

    QFile f("Cộng hòa xã hội.rar"); // I am hardcoding filename for example only, in my app I get this name from QDir::entryList()
    qDebug(f.fileName ().toLocal8Bit().constData());

    This code outputs correct in my PC where Language is English however same code doesn't work for the Window 7 PC where language is "Vietnamese".
    Output there is some junk characters.

    Is something wrong with my code ?

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Problem with Vietnamese Characters

    This is likely to be a difference between the encoding used on the build machine to turn your string literal into bytes and the encoding used on the target machine and its file system. Without more information on those it is hard to say.

Similar Threads

  1. Replies: 3
    Last Post: 23rd April 2011, 17:42
  2. Problem with korean characters display
    By giriprasad in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 27th September 2009, 09:40
  3. Qt for S60, problem with bold polish characters
    By Wiktor in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 26th August 2009, 10:37
  4. Problem with accented characters
    By gt.beta2 in forum Qt Programming
    Replies: 2
    Last Post: 14th April 2009, 22:20
  5. Problem extracting special characters from DB
    By mourad in forum Qt Programming
    Replies: 2
    Last Post: 28th April 2008, 08:59

Tags for this Thread

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.