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

[REG: 5.6.2->5.7.1]: QJsonDocument::fromJson() fails to parse special numbers such as "0E-8"

    XMLWordPrintable

Details

    • 8616b2112c0f24f71892488cefb146ae3505da9e

    Description

      When using QJsonDocument::fromJson(), it fails to parse special number such as "0E-8".

      Culprit JSON could look something like:

      { "num": 0E-8 }

      This is a regression from 5.6.2 to 5.7.1. It works in 5.6.2 but in no versions after that (5.8, 5.9). QJSEngine can properly parse the same JSON code, so the problem lies in QJsonDocument. Online JSON validators can also validate the given JSON as proper.

      Steps to reproduce:

      • Run attached sample
      • EXPECTED: Sample runs fine without errors
      • ACTUAL: Sample fails to parse the given JSON with "illegal number" (7) error

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              thiago Thiago Macieira
              jussi_witick Jussi Witick
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes