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

Problems with UTF-8 in QJsonObject keys

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • 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

    Description

      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.

      Attachments

        1. test01.json
          0.1 kB
        2. test02.json
          0.1 kB
        3. testcase_main.cpp
          2 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes