MantisBT - Doomseeker
View Issue Details
0003534Doomseeker[All Projects] Bugpublic2018-10-06 09:232018-10-13 16:54
WubTheCaptain 
Zalewa 
normaltrivialalways
closedfixed 
1.2 
1.21.2 
0003534: Qt4's assumption of Latin-1 encoding decodes UTF-8 characters in Doomseeker built with Qt4 incorrectly (language configuration)
"Español" gets garbled into "Espanñol" (or similar) in configuration, because of UTF-8 characters not being expected in Doomseeker built with Qt4. Support for UTF-8 characters would need to be explicitly added in Qt4.

See attached screenshot.
Grab a "recent" source of Doomseeker 1.2~beta from Mercurial tip (where development happens), with Spanish translation built-in.

To build Doomseeker with Qt4, do:

cmake -DFORCE_QT4=YES $DOOMSEEKER_SRC
make -j$(nproc) # or just make -j4 for example, there's no nproc(1) on OpenBSD


where $DOOMSEEKER_SRC is the location of source code.

Launch Doomseeker and navigate to:

  1. Options
  2. Configure (F5)
  3. Appearance
Not reproducible in Qt5, because Qt5 expects UTF-8 and UTF-8 only.

'https://wiki.qt.io/index.php?title=Strings_and_encodings_in_Qt&oldid=23630 [^]'
No tags attached.
related to 0003503closed Zalewa Qt4's assumption of Latin-1 encoding decodes UTF-8 characters in Doomseeker built with Qt4 incorrectly (about dialog) 
child of 0003486closed Pol M Translate Doomseeker to Spanish 
png 2018-10-06-091643_534x118_scrot.png (13,922) 2018-10-06 09:23
https://zandronum.com/tracker/file_download.php?file_id=2419&type=bug
png
Issue History
2018-10-06 09:23WubTheCaptainNew Issue
2018-10-06 09:23WubTheCaptainStatusnew => assigned
2018-10-06 09:23WubTheCaptainAssigned To => Zalewa
2018-10-06 09:23WubTheCaptainFile Added: 2018-10-06-091643_534x118_scrot.png
2018-10-06 09:24WubTheCaptainRelationship addedrelated to 0003503
2018-10-06 09:25WubTheCaptainDescription Updatedbug_revision_view_page.php?rev_id=12105#r12105
2018-10-06 09:25WubTheCaptainAdditional Information Updatedbug_revision_view_page.php?rev_id=12107#r12107
2018-10-06 09:27WubTheCaptainRelationship addedchild of 0003486
2018-10-06 18:48ZalewaNote Added: 0019961
2018-10-06 18:48ZalewaStatusassigned => needs testing
2018-10-06 18:49ZalewaNote Edited: 0019961bug_revision_view_page.php?bugnote_id=19961#r12160
2018-10-06 19:02WubTheCaptainNote Added: 0019962
2018-10-06 19:02WubTheCaptainStatusneeds testing => resolved
2018-10-06 19:02WubTheCaptainFixed in Version => 1.2
2018-10-06 19:02WubTheCaptainResolutionopen => fixed
2018-10-13 16:54WubTheCaptainStatusresolved => closed

Notes
(0019961)
Zalewa   
2018-10-06 18:48   
(edited on: 2018-10-06 18:49)
QString contains a constructor that allows to implicitly convert to its type a QByteArray, which in this case is provided from QIODevice::readLine(). The reason why this "works" "properly" in Qt5 and doesn't in Qt4 becomes apparent when you compare the documentation for this constructor for both versions of Qt and notice that in Qt4 it uses "fromAscii()" to convert to string type and in Qt5 it uses "fromUtf8()".

An explicit call to QString::fromUtf8() should fix the problem:'https://bitbucket.org/Doomseeker/doomseeker/commits/657feabd0feb968f3ac330ac9009921c8dab3608 [^]'

(0019962)
WubTheCaptain   
2018-10-06 19:02   
Zalewa's patch works with both Debian GNU/Linux and OpenBSD built with Qt4.