Anyone have any idea how to get the value of "Language for Non-Unicode Programs" in Control Panel Regional Settings programmatically using c#?
任何人都知道如何使用c#以编程方式在控制面板区域设置中获取“非Unicode程序的语言”的值?
Already tried CultureInfo, RegionInfo and getting the default encoding using the Encoding object, but I can only get the Standards and Formats value or the main code page.
已经尝试过CultureInfo,RegionInfo并使用Encoding对象获取默认编码,但我只能获得Standards and Formats值或主代码页。
3 个解决方案
#1
4
GetSystemDefaultLocaleName or GetSystemDefaultLCID (and its P/Invoke declaration)
GetSystemDefaultLocaleName或GetSystemDefaultLCID(及其P / Invoke声明)
#2
1
The NLS Terminology page in Internationalization for Windows Applications has the answer:
国际化Windows应用程序中的NLS术语页面有答案:
An ANSI application should check the language for non-Unicode programs setting during installation. It uses GetACP or GetOEMCP to retrieve the value. No function is supported to set the language for non-Unicode programs.
ANSI应用程序应在安装期间检查非Unicode程序设置的语言。它使用GetACP或GetOEMCP来检索值。不支持为非Unicode程序设置语言的功能。
The GetACP
function returns the "ANSI code page" (e.g. 1252 for english), while GetOEMCP
returns the "OEM code page" (the code page used in the console, 437 for english).
GetACP函数返回“ANSI代码页”(例如英语为1252),而GetOEMCP返回“OEM代码页”(控制台中使用的代码页,英语为437)。
Code Pages has more information about code pages in Windows.
代码页有关于Windows中代码页的更多信息。
#3
0
IIRC, Thread.CurrentUICulture
gets that value.
IIRC,Thread.CurrentUICulture获得该值。
#1
4
GetSystemDefaultLocaleName or GetSystemDefaultLCID (and its P/Invoke declaration)
GetSystemDefaultLocaleName或GetSystemDefaultLCID(及其P / Invoke声明)
#2
1
The NLS Terminology page in Internationalization for Windows Applications has the answer:
国际化Windows应用程序中的NLS术语页面有答案:
An ANSI application should check the language for non-Unicode programs setting during installation. It uses GetACP or GetOEMCP to retrieve the value. No function is supported to set the language for non-Unicode programs.
ANSI应用程序应在安装期间检查非Unicode程序设置的语言。它使用GetACP或GetOEMCP来检索值。不支持为非Unicode程序设置语言的功能。
The GetACP
function returns the "ANSI code page" (e.g. 1252 for english), while GetOEMCP
returns the "OEM code page" (the code page used in the console, 437 for english).
GetACP函数返回“ANSI代码页”(例如英语为1252),而GetOEMCP返回“OEM代码页”(控制台中使用的代码页,英语为437)。
Code Pages has more information about code pages in Windows.
代码页有关于Windows中代码页的更多信息。
#3
0
IIRC, Thread.CurrentUICulture
gets that value.
IIRC,Thread.CurrentUICulture获得该值。