本文介绍了C ++ Win32 API等同于CultureInfo.TwoLetterISOLanguageName的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
.NET框架可以轻松获取各种语言环境的信息;
在Win32中有一个等效的函数来获取两个字母的ISO语言名称给定一个整数区域设置ID? / p>
在C#中我会:
System.Globalization.CultureInfo ci = new System.Globalization.CultureInfo(1034);
string iso = ci.TwoLetterISOLanguageName;
// iso ==es。
代码需要在XP和更新版本上运行。
请致电,其中包含参数。
The .NET framework makes it easy to get information about various locales; the Win32 C++ APIs are a bit harder to figure out.
Is there an equivalent function in Win32 to get the two-letter ISO language name given an integer locale ID?
In C# I'd do:
System.Globalization.CultureInfo ci = new System.Globalization.CultureInfo(1034);
string iso = ci.TwoLetterISOLanguageName;
// iso == "es" now.
The code needs to run on XP and newer.
解决方案
Thanks to Trevor for directing me toward this answer in an earlier reply.
Call GetLocaleInfo with the LOCALE_SISO639LANGNAME parameter.
这篇关于C ++ Win32 API等同于CultureInfo.TwoLetterISOLanguageName的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-19 11:50