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

Problems with UTF-8 in QJsonObject keys

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P2: Important P2: Important
    • 5.4.0 Beta
    • 5.3.1
    • Core: Other
    • None
    • Current debian testing:
      $ apt-cache policy libqt5core5a
      libqt5core5a:
        Installed: 5.3.1+dfsg-3

      I placed a unicode value of subscript 'a' (\u2090) in the key of a JSON file inside an object, and loaded it as document. This causes some values in the object, which are in the file after this key, to be read incorrectly, typically as null, but sometimes as undefined. The same applies when I put the unicode escape sequence in the key.

      Interestingly, dumping the whole QJsonObject to qDebug() produces the expected output.

      According to the JSON RFC, it occurs to me that the usage of this type of unicode character is valid in keys.

        1. test01.json
          0.1 kB
        2. test02.json
          0.1 kB
        3. testcase_main.cpp
          2 kB
        For Gerrit Dashboard: QTBUG-41100
        # Subject Branch Project Status CR V

            laknoll Lars Knoll
            borach Borach
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes