chewing / chewing-editor

Cross platform chewing user phrase editor
https://chewing.im/
GNU General Public License v2.0
31 stars 52 forks source link

Fail to build from source in big-endian platform #53

Open czchen opened 8 years ago

czchen commented 8 years ago

See https://bugs.debian.org/814124

Chocobo1 commented 8 years ago

Probably related to #24.

czchen commented 8 years ago

The following is result from s390x build. Looks like QJsonValue.toString has different byte order then QString. Need to figure out which one is wrong.

/home/czchen/src/chewing-editor-0.0.1/test/testChewingExporter.cpp:96: Failure
Value of: obj["phrase"].toString()
  Actual: { 2-byte object <2C-6E>, 2-byte object <66-8A> }
Expected: QString("\xE6\xB8\xAC\xE8\xA9\xA6" )
Which is: { 2-byte object <6E-2C>, 2-byte object <8A-66> }
/home/czchen/src/chewing-editor-0.0.1/test/testChewingExporter.cpp:99: Failure
Value of: obj["bopomofo"].toString()
  Actual: { 2-byte object <18-31>, 2-byte object <1C-31>, 2-byte object <CB-02>, 2-byte object <20-00>, 2-byte object <15-31>, 2-byte object <CB-02> }
Expected: QString("\xE3\x84\x98\xE3\x84\x9C\xCB\x8B \xE3\x84\x95\xCB\x8B" )
Which is: { 2-byte object <31-18>, 2-byte object <31-1C>, 2-byte object <02-CB>, 2-byte object <00-20>, 2-byte object <31-15>, 2-byte object <02-CB> }
czchen commented 8 years ago

QJsonValue.toString does not create the correct QString in big-endian platform. Need to submit this issue to upstream.

/home/czchen/src/chewing-editor-0.0.1/test/testChewingExporter.cpp:96: Failure
Value of: obj["phrase"].toString().toUtf8()
  Actual: { '\xE2' (226), '\xB1' (177), '\xAE' (174), '\xE6' (230), '\x9A' (154), '\x8A' (138) }
Expected: QString("\xE6\xB8\xAC\xE8\xA9\xA6").toUtf8()
Which is: { '\xE6' (230), '\xB8' (184), '\xAC' (172), '\xE8' (232), '\xA9' (169), '\xA6' (166) }
/home/czchen/src/chewing-editor-0.0.1/test/testChewingExporter.cpp:99: Failure
Value of: obj["bopomofo"].toString().toUtf8()
  Actual: { '\xE1' (225), '\xA0' (160), '\xB1' (177), '\xE1' (225), '\xB0' (176), '\xB1' (177), '\xEC' (236), '\xAC' (172), '\x82' (130), '\xE2' (226), '\x80' (128), '\x80' (128), '\xE1' (225), '\x94' (148), '\xB1' (177), '\xEC' (236), '\xAC' (172), '\x82' (130) }
Expected: QString("\xE3\x84\x98\xE3\x84\x9C\xCB\x8B \xE3\x84\x95\xCB\x8B" ).toUtf8()
Which is: { '\xE3' (227), '\x84' (132), '\x98' (152), '\xE3' (227), '\x84' (132), '\x9C' (156), '\xCB' (203), '\x8B' (139), ' ' (32, 0x20), '\xE3' (227), '\x84' (132), '\x95' (149), '\xCB' (203), '\x8B' (139) }
Chocobo1 commented 8 years ago

should we close this one? it's a upstream bug, IMO we need not to track it.