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

Konstantin Tokarev annulen at yandex.ru
Thu Mar 3 13:06:05 CET 2011



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 :)

Program exists on 

if (!ifs)
      return 0;


-- 
Regards,
Konstantin



More information about the Qt-interest-old mailing list