Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Qt-embedded 4.5 Japanese symbol rendered as simplified Chinese



  • Hi there,

    The issue I have here is when I want to display a label with Japanese translation of the word Diameter then I only get the simplified Chinese version of it.
    I'm translating with QtLinguist and in the translated file (.ts) the symbol is correct but is always rendered incorrectly as simplified Chinese.

    The following image depicts the problem:
    (jp-error-qtforum.png image url)

    The upper half is the QtLinguist window showing how the word Diameter translates correctly.
    The bottom half is the screen from my program where the same word is now in simplified Chinese.

    I wonder if this is a bug or the default behavior ? because I've seen related issue when using Google Translate and translating from English to Chinese the result window (translated text) is showing simplified Chinese but when I choose to copy that result over to my text editor or on the command prompt it always gives me the symbol version resembling the Japanese one. In short, the reverse is happening.

    Hope to get some insight into this.

    regards
    Einar


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Did you check whether you have the same font on both systems ?
    Are you sure that the local is properly set ?

    Are you really on Qt 4.5 ?



  • @SGaist hi and thanks for your response.

    The thing is that this is an embedded target running Qt 4.5 with EGLFS.
    I'm not fully sure how Qt operates the locale, is that correct that if it finds the executable locale it will base it's localization on that else it falls back to some default built-in ?

    The thing is that the locale executable is not installed on our targets but all the supporting files are there, i.e. /usr/share/locale/ with all the languages files. So how would Qt approach the localization in that scenario ?

    Also the Japanese seems to be correctly rendered for all other symbols except the diameter word as I mentioned before.
    So I'm a bit confused !!!



  • @Einar
    I tried to type that two Chinese symbols in google translate and translate them to Japanese, the output is exactly the same as the Japanese symbols in your picture.
    Then I copy that two Japanese symbols and paste here, and they become Chinese symbols!
    So they are totally same symbols in unicode. Just in different fonts...



  • @Bonnie hi and thank you for your response.

    I did wonder if that was the case also but couldn't tell for sure since I'm not a font specialist and more so not Chineses nor Japanese.
    Could you tell me which font is being used in both cases ?



  • @Einar
    From the google translate webpage, the Chinese font is "Microsoft YaHei" and the Japanese font is "Meiryo".



  • @Bonnie If I investigate the element of both Chinese and Japanese translation of the word 'diameter' it both has Roboto, Arial, Sans-serif.
    Where did you see these what those fonts are ?



  • @Einar
    By "inspect"ing the element from Chrome -> "Computed" -> "Rendered Fonts".
    And my Windows language is Chinese. Don't know if this is related...



  • @Bonnie thanks for your response again.
    This is the same inspection as I did but got Roboto, Arial, Sans-Serif. I'm running on Ubuntu 2020 with English as my language.

    My original question was more related to how Qt font rendering behaves, i.e. how does it figure out what type to use ?



  • Is it possible that since Qt 4.8 uses Shift JIS charset for Japanese and gbk 18030 (Big5 family) for Chinese that do have some parts quite in similar that the word "Diameter" uses incorrect charset when decoding ? i.e. falls back on the Chinese one instead of using the Japanese ?


Log in to reply