From: Pete B. <pb...@gm...> - 2012-05-16 00:08:02
|
On 2012.05.16 00:29, Xiaofan Chen wrote: > Under my English Windows XP SP3 with Chinese Locale (Language for > Non-Unicode Program set to Chinese). > > 1) Build with MinGW gcc 4.6.2 > mcuee@dellxp /c/work/mingw/test > $ ./test1_mingw32.exe > tolower(0xe9) = 0xe9 > tolower(0xe9) = 0xe9 > > 2) Build with TDM64 (MinGW-w64 4.6.1), adding "-m32" to build > 32bit binary > mcuee@dellxp /c/work/mingw/test > $ ./test1_tdm64_win32.exe > tolower(0xe9) = 0xe9 > tolower(0xe9) = 0xe9 Interesting. I just tested a 4th machine with XP installed and an "English (Ireland)" locale, and still observed the same results as with 7 (second output = 0xa3). And in the virtual XP mode of Windows 7, when running the same program, I got 0x3f. Thus I would think the problem will also manifest itself with XP, as long as a western locale is in use. What I suspect, that would explain your results, is that the second tolower() call is dependent on the system locale/codepage for lowercase conversion, and AFAIK (correct me if I'm wrong) there's no lowercase conversion for Chinese characters. So that might explain why an 0xe9, in a Chinese codepage would still be left unchanged. Regards, /Pete |