[Qt-interest] Non-latin characters in QString and char * on Windows

Thiago Macieira thiago at kde.org
Thu Mar 3 14:24:57 CET 2011


On Thursday, 3 de March de 2011 15:06:05 Konstantin Tokarev wrote:
> 03.03.2011, 14:21, "Thiago Macieira" <thiago at kde.org>:
> > On Thursday, 3 de March de 2011 11:48:24 Konstantin Tokarev wrote:
> >>      cout << fileNameArr.data() << '\n'
> >>              << fileNameStr << endl;
> > 
> > [snip]
> > 
> >>  On Windows I get two (identical) lines with broken Cyrillic
> >> characters and no "OK" On Linux I get two (identical) correct lines
> >> and "OK".
> >> 
> >>  Any ideas?
> > 
> > Yes, "you're using Windows".
> > 
> > Remember that the command-prompt's window encoding is different from
> > what
> > Windows considers the "ANSI" encoding. Windows has two 8-bit encodings
> > used in parallel: the DOS legacy codepage and the Windows non-Unicode
> > API. So seeing something wrong in that listing isn't a problem.
> 
> I realize it, but actual problem is that ifstream also sees something wrong
> :)


Ok, then let's drop down to bytes.

What are the hex values of the bytes that the QByteArray contains? And what 
were those values expected to be?

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Senior Product Manager - Nokia, Qt Development Frameworks
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110303/a92266a6/attachment.bin 


More information about the Qt-interest-old mailing list