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

QJsonDocument fails to serialize non-latin characters on Big Endian platform

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.6.0 RC
    • 5.3.2, 5.4.2, 5.6.0 Beta
    • Core: Other
    • None
    • mips64 single core CPU (KOMDIV-64), Debian GNU/Linux 8.2 (jessie)
    • 434302eae1a0c5d3016fe07c7d343bdbad118a8a

    Description

      When trying to serialize QJsonObject containing non-latin (in our case: cyrillic) string as a value, QJsonDocument produces the corrupted result on the Big Endian platform.

      Here is the results of running the attached test on MIPS-based platform.

      ********* Start testing of TestClass *********
      Config: Using QtTest library 5.3.2, Qt 5.3.2
      PASS   : TestClass::initTestCase()
      PASS   : TestClass::checkSerialize(latin)
      FAIL!  : TestClass::checkSerialize(cyrillic) Compared values are not the same
         Actual   (serializedJson): 7B 22 74 65 73 74 22 3A 22 E1 BC 84 E4 80 84 E3 B8 84 E3 88 84 E3 94 84 E4 80 84 E3 A8 84 E3 80 84 22 7D
         Expected (json)          : 7B 22 74 65 73 74 22 3A 22 D0 9F D1 80 D0 BE D0 B2 D0 B5 D1 80 D0 BA D0 B0 22 7D
         Loc: [testclass.cpp(56)]
      PASS   : TestClass::checkDeserialize(latin)
      PASS   : TestClass::checkDeserialize(cyrillic)
      PASS   : TestClass::cleanupTestCase()
      Totals: 5 passed, 1 failed, 0 skipped
      ********* Finished testing of TestClass *********
      

      Same test works just fine on x86-64. I know this CPU may seem pretty exotic and rare, but it runs standard Debian MIPS distibution and I am pretty sure the problem will be reproducible on any Big Endian platform.

      Attachments

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

        Activity

          People

            thiago Thiago Macieira
            cyberbobs Boris Moiseev
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes