Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED] How to display Japanese character with Qt5.3 on a Japanese machine
QtWS25 Last Chance

[SOLVED] How to display Japanese character with Qt5.3 on a Japanese machine

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 1.7k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pyl0420
    wrote on last edited by
    #1

    Hi:

    Our product shows lots of garbage characters with Qt5 on a Japanese machine :( I guess the reason is the removal of setCodecForCStrings and Qt now expects the source code to use UTF8.

    I saw some posts suggested to save the file to Unicode, unfortunately it is impossible for us to do it. Besides, we are still passing the strings around as char* or std::string >.< Any suggestion of other workarounds?

    Thanks,
    -Ollie

    1 Reply Last reply
    0
    • JKSHJ Offline
      JKSHJ Offline
      JKSH
      Moderators
      wrote on last edited by
      #2

      Hi,

      [quote author="Ollie" date="1402788045"]
      I saw some posts suggested to save the file to Unicode, unfortunately it is impossible for us to do it.[/quote]I'm curious: Why not?

      One workaround is to use manually pass your C strings through a "QTextCodec":http://qt-project.org/doc/qt-5/qtextcodec.html to convert them to Unicode

      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

      1 Reply Last reply
      0
      • P Offline
        P Offline
        pyl0420
        wrote on last edited by
        #3

        [quote author="JKSH" date="1402818487"]Hi,

        I'm curious: Why not?

        One workaround is to use manually pass your C strings through a "QTextCodec":http://qt-project.org/doc/qt-5/qtextcodec.html to convert them to Unicode[/quote]

        Thanks JKSH, the QTextCodec::toUnicode works fine.

        Technically it may be possible, but we are so close to the deadline, trying to find a easy way out here XD

        Thanks,
        -Ollie

        1 Reply Last reply
        0
        • JKSHJ Offline
          JKSHJ Offline
          JKSH
          Moderators
          wrote on last edited by
          #4

          I see. Glad I could help. All the best with your project! :)

          P.S. Please edit your original post to add "[SOLVED]" to the title

          Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved