GetPlatformLocale does not return a correct LCID. LCID for "en-US" is 1033 but I am getting 54. Looks like it's just returning the first entry of the table. No country table is used, this is also a problem.
Summary: nsIWin32Locale.GetPlatformLocale deos not return correct LCID → Locale- nsIWin32Locale.GetPlatformLocale deos not return correct LCID
Status: ASSIGNED → RESOLVED
Last Resolved: 20 years ago
Resolution: --- → FIXED
Fixed. Checked in 3/5/98.
I verified it's working for en-US, en-GB, fr-FR, de-DE and ja-JP. Can this also support locale to charset name mapping or it's someone else's task? E.g. en_US -> iso-8859-1 I need this for the conversion in order to talk to non unicode API.
** Checked with 4/8/99 evening Win32 build ** Following nhotta's 4/7/99 comment, I'll be marking this fix verified. LocaleSelfTest.exe does include self-test mechanism for several locales mentioned in nhotta's comment. (Try 'LocaleSelfTest -v'.) The values obtained by the selft tests are: en_US = 0x0409 en_GB = 0x0809 fr_FR = 0x040c de_DE = 0x0407 ja_JP = 0x0411 These are all correct Win32 Locale ID hex values. Given these results, it's safe to assume that GetPlatformLocale is returning correct values for given locales.
The source for LocaleSelfTest can be viewed here: http://lxr.mozilla.org/mozilla/source/intl/locale/tests/LocaleSelfTest.cpp Check out the source files from this directory: mozilla/source/intl/locale/tests
happy. if you want a more direct verification, you can run nsLocaleTest - of course since i wrote it it might be biased :)
You need to log in before you can comment on or make changes to this bug.