GetGeoInfo will be turned to GetGeoInfoW (Unicode version) when 'UNICODE' is defined, which is a 'recommended' way on 'modern' Windows (because Windows 9x/ME is not a worry any more).
GetGeoInfoW expects the 3rd parameter to be LPWSTR ('wide' string) but ISOcode is LPSTR ('narrow' string).
In this particular case, we should explicitly call 'A' version because ISOcode is always in ASCII.
Activity
Show:
UnicodeBot July 1, 2018 at 12:09 AM
Trac Comment 7 by —2014-06-06T23:21:08.646Z
LGTM
UnicodeBot July 1, 2018 at 12:09 AM
Trac Comment 3.4 by —2014-05-03T16:39:01.173Z
Replying to (Comment 3 jungshik):
Why would you use UChar for ISOCode?
Because GetGeoInfoW() takes WCHAR which is the same as UChar.
This is an implementation detail. We are not discussing any API change here.
The 'A' versions of Windows functions are not available on Windows CE/Phone. We don't need to support Windows 9x any more, so we should move to 'W' versions of Windows functions.
UnicodeBot July 1, 2018 at 12:09 AM
Trac Comment 3 by —2014-05-03T06:42:49.170Z
Why would you use UChar for ISOCode? Will it ever contain any character outside the ASCII? Some ICU APIs do that (using UChar for locale ids, e.g.) and it makes harder to use them in some cases.
UnicodeBot July 1, 2018 at 12:09 AM
Trac Comment 2 by —2014-04-30T18:27:55.635Z
We should use a UChar ISOcode and call GetGeoInfoW().
wintz has the following.
GetGeoInfo will be turned to GetGeoInfoW (Unicode version) when 'UNICODE' is defined, which is a 'recommended' way on 'modern' Windows (because Windows 9x/ME is not a worry any more).
GetGeoInfoW expects the 3rd parameter to be LPWSTR ('wide' string) but ISOcode is LPSTR ('narrow' string).
In this particular case, we should explicitly call 'A' version because ISOcode is always in ASCII.