Click here to Skip to main content
15,886,842 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Please see the first column of the table on following link. I need the language culture name in that format.

Table of Language Culture Names, Codes, and ISO Values Method [C++][^]

Currently i am using GetLocaleInfo to get the information aboout language and country name (and then concatenate them like en-US). But it fails for some languages like Chinese - simplified.

For chinese simplified the code is zh-CHS ..... My method gives me zh-CN.

What is the right way to get this information.

What I have tried:

Currently i am using GetLocaleInfo to get the information aboout language and country name (and then concatenate them like en-US). But it fails for some languages like Chinese - simplified.

For chinese simplified the code is zh-CHS ..... My method gives me zh-CN.
Posted
Updated 1-Jun-17 20:24pm

1 solution

This job should do your GetLocaleInfo with the correct flags like LOCALE_USER_DEFAULT. Also check out GetLocaleInfoEx and its various flags.

It may depend on the Windows version and may fail on older Windows like the retired XP. So test it on Windows 10. I wouldnt wonder if there is some bug in older Windows in that detail.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900