Important: Please read the Qt Code of Conduct -

XML file with multiple languages

  • Hello, I need some tips. I have an XML file that has multiple words in different languages. Is is possible to correctly load the file and the contents ? Some of the contents are in Spanish, French and Ukrainian. Right now I'm using QXmlInputSource and QXmlSimpleReader to parse the file. It works good to parse the FR and SP words, but the Ukrainian appears has ????.

    E.G of the XML file:
    <BTN name="ui_1" fr="Menu" sp="Menu" ur="Меню"></BTN>

    Any ideas ?
    Can my app be multi language ?

  • Moderators

    Yes, it should be possible. Make sure the file is opened in UTF-8 mode.

    If you want this to translate your application, why not use the built-in Qt translation system?

  • In my case I wanted to make a personalized translation mechanism. The things is, if I use encoding="iso-8859-1" at the XML file the chars appear correct, but if I use UTF-8, I get ??? for the Ukrainian chars. ideas ?

  • Usually the characters that are not supported are replaced by ???
    Have you saved the file in UTF-8?

Log in to reply