Windows操作系统的设立 与 C语言setlocale函数
Windows操作系统的设置 与 C语言setlocale函数
setlocale(LC_ALL,"")所获取的区域设置实际上就是”格式”选项卡中的设置。(已验证)
在“管理”选项卡中的“系统区域设置”又是什么?
ANSI文本文档在更改“系统区域设置”后,用记事本打开将是“乱码”;UltraEdit的显示界面也会乱码。他们受系统区域设置的影响。
“格式”选项卡让应用程序获取“区域设置”的信息,“系统区域设置”又是为谁服务的呢?
------解决方案--------------------
推荐使用软件SoftSnoop获取某进程调用了哪些Win API。
------解决方案--------------------
你用 LC_ALL 只是这些设置中的一个, 设置成不同的值来看看吧, LC_CTYPE 应该会是 “系统区域设置” 里的值.
LC_ALL
All categories, as listed below.
LC_COLLATE
The strcoll, _stricoll, wcscoll, _wcsicoll, strxfrm, _strncoll, _strnicoll, _wcsncoll, _wcsnicoll, and wcsxfrm functions.
LC_CTYPE
The character-handling functions (except isdigit, isxdigit, mbstowcs, and mbtowc, which are unaffected).
LC_MONETARY
Monetary-formatting information returned by the localeconv function.
LC_NUMERIC
Decimal-point character for the formatted output routines (such as printf), for the data-conversion routines, and for the non-monetary formatting information returned by localeconv. In addition to the decimal-point character, LC_NUMERIC also sets the thousands separator and the grouping control string returned by localeconv.
LC_TIME
The strftime and wcsftime functions.
“系统区域设置” 会影响 WideCharToMultiByte 和 MultiByteToWideChar 这两个 API.
setlocale(LC_ALL,"")所获取的区域设置实际上就是”格式”选项卡中的设置。(已验证)
在“管理”选项卡中的“系统区域设置”又是什么?
ANSI文本文档在更改“系统区域设置”后,用记事本打开将是“乱码”;UltraEdit的显示界面也会乱码。他们受系统区域设置的影响。
“格式”选项卡让应用程序获取“区域设置”的信息,“系统区域设置”又是为谁服务的呢?
------解决方案--------------------
推荐使用软件SoftSnoop获取某进程调用了哪些Win API。
------解决方案--------------------
你用 LC_ALL 只是这些设置中的一个, 设置成不同的值来看看吧, LC_CTYPE 应该会是 “系统区域设置” 里的值.
LC_ALL
All categories, as listed below.
LC_COLLATE
The strcoll, _stricoll, wcscoll, _wcsicoll, strxfrm, _strncoll, _strnicoll, _wcsncoll, _wcsnicoll, and wcsxfrm functions.
LC_CTYPE
The character-handling functions (except isdigit, isxdigit, mbstowcs, and mbtowc, which are unaffected).
LC_MONETARY
Monetary-formatting information returned by the localeconv function.
LC_NUMERIC
Decimal-point character for the formatted output routines (such as printf), for the data-conversion routines, and for the non-monetary formatting information returned by localeconv. In addition to the decimal-point character, LC_NUMERIC also sets the thousands separator and the grouping control string returned by localeconv.
LC_TIME
The strftime and wcsftime functions.
“系统区域设置” 会影响 WideCharToMultiByte 和 MultiByteToWideChar 这两个 API.