Post by Mihai N.Post by DavidThe problem is that it does not work on Win7 English edition with Hong
Kong language pack.
Must be Unicode for that.
Not true. The resources are built with 8-bit ANSI code-page specific
characters. I have solved the problem and gotten this to work
properly.
Post by Mihai N.Post by DavidIt also works on both of those when built with VS6.
Sorry, I don't believe that.
Why don't you believe that? Why would you think I would lie about how
the program works - would doing so help me get a valid answer?
Post by Mihai N.Post by DavidThe fundamental question is: what is different between the native Hong
Kong Win7 and Win7 with HK language pack systems?
Language pack has nothing to do with it.
What matters is the system locale, which determines the system code page.
See here:http://www.mihai-nita.net/article.php?artID=20050611a
Set the system locale (or "Language for non-Unicode Programs") to
Chinese Hong Kong, reboot and it will work.
The other thing that might matter is on what system are you building the
thing (not the compiler version).
If the resources are encoded in big-5 (no UTF-8, the resource compiler
does not support utf-8) then you have to compile them on a Traditional
Chinese system, or have the proper #pragma code_pag
- How do you compile the resources
- The application is Unicode or not
- If not, then the system code page
As Ivo already explained, ?? means that characters were converted to a code
page that cannot represent them.
That can be when you compile the resources (case 1) or at runtime
(because the app is not Unicode and the system code page is not big-5)
--
Mihai Nita [Microsoft MVP, Visual C++]http://www.mihai-nita.net
------------------------------------------
Replace _year_ with _ to get the real email
To sum up the solution:
1) The difference between the native Hong Kong Win7 system and an
English system with HK language pack appears to be that the locale
used for non-Unicode programs on the latter system is the English-
language locale, while the HK-native version of course used the HK
locale. Hence, the English-language version doesn't use the 8-bit
characters against the correct code page (950) and doesn't have the
correct characters.
2) VS6 apparently apparently defaults to the USER's default locale
(and code page) as specified in the .rc file while VS2008 doesn't do
so.
3) The solution is to add a call to
SetThreadLocale(LOCALE_USER_DEFAULT) to the program. Then all works
properly.
Thanks to all who attempted to understand and solve this problem.