views:

63

answers:

1

I want to get current country code for oldest Windows systems.

I was using GetLocaleInfo() with LOCALE_ICOUNTRY flag, but then I've realized it returns wrong results (the same values for different countries), so I've tried LOCALE_SISO3166CTRYNAME which returns country code in ISO3166 standard 2 letters code (eg. 'US')

http://www.iso.org/iso/english_country_names_and_code_elements

...it works fine, but not on the oldest Windows versions.

So my question is, how to get valid country code (identifier, name, whatever...) on Windows 95 / NT 3.51?

+1  A: 

I'm not entirely sure if it applies in your case, but there was a bug in the old (pre 1.25A) versions of Win32S where GetLocaleInfo() would return incorrect information for most non-US locales. (See: w32s125a.txt).

I find it likely that this bug might also have been present in early Win95 and NT 3.51.

I'm way curious to know why you would be writing code for such ancient operating systems though!

Seth
Nah, it works fine with LOCALE_ICOUNTRY flag (OSR2 tested), but that's not the thing I want, and LOCALE_SISO3166CTRYNAME isn't supported for those operating systems (Michael Kaplan from Microsoft wrote about it on his blog http://blogs.msdn.com/michkap/archive/2005/03/29/403216.aspx). I need it for my client.
Bartosz Wójcik