Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-141576

JSON parsing gets wrong with accentuated characters

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Not Evaluated Not Evaluated
    • None
    • 6.10.0
    • Core: Serialization
    • None
    • macOS

      Considering the following JSON file:

      {    
         "contrôle": "c0cb8b2de37c04fec6106ab1ec3843aec8f38bf5",    
         "méta": {        
             "auteur": "",        
             "auteur_derniere_modification": "JohnDoe"
         },    
         "réglages": {        
             "toto": "tata"
         }
      }

      When I run the following code:

      QJsonParseError error;
      auto& doc = QJsonDocument::fromJson(f.readAll(), &error);
      const auto& obj = doc.object();

      My keys in `obj` are malformed and appear as chinese characters...

      So I am stucked.

      The same code worked perfectly with Qt 6.9.3 on macOS.

        1. qtbug-141576.tar.zst
          1 kB
          Thiago Macieira
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            thiago Thiago Macieira
            estebi Tristan Israël
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes