System Locale: en-us;English (United States)
Input Locale: en-us;English (United States)
运行systeminfo.exe时,有用信息包括以上两行。 Windows API或C运行时函数是否提供字符串英语(美国)?
答案 0 :(得分:0)
它可以用GetLocaleInfo
。我想,LCTYPE是LOCALE_SENGLANGUAGE / LOCALE_SENGCOUNTRY。
#include <windows.h>
#include <stdio.h>
int
main() {
char language[256] = {0}, country[256] = {0};
GetLocaleInfo(
GetUserDefaultLCID(),
LOCALE_SENGLANGUAGE,
language,
sizeof(language));
GetLocaleInfo(
GetUserDefaultLCID(),
LOCALE_SENGCOUNTRY,
country,
sizeof(country));
printf("%s (%s)\n", language, country);
}
// I got "Japanese (Japan)"