多字节字符序列的解释Interpretation of Multibyte-Character Sequences

Microsoft 运行库中的大多数多字节字符例程可识别与多字节代码页相关的多字节字符序列。Most multibyte-character routines in the Microsoft run-time library recognize multibyte-character sequences relating to a multibyte code page. 输出值受区域设置的 LC_CTYPE 类别设置影响;有关详细信息,请参阅 setlocaleThe output value is affected by the setting of the LC_CTYPE category setting of the locale; see setlocale for more information. 这些不带 _l 后缀的函数版本使用此区域设置相关的行为的当前区域设置;带有 _l 后缀的版本相同,只不过它们使用传递的区域设置参数。The versions of these functions without the _l suffix use the current locale for this locale-dependent behavior; the versions with the _l suffix are identical except that they use the locale parameter passed in instead.

与区域设置相关的多字节例程Locale-Dependent Multibyte Routines

例程所返回的值Routine 使用Use
_mbclen、mblen、_mblen_l_mbclen, mblen, _mblen_l 验证并返回多字节字符中的字节数Validate and return number of bytes in multibyte character
strlen、wcslen、_mbslen、_mbslen_l、_mbstrlen、_mbstrlen_lstrlen, wcslen, _mbslen, _mbslen_l, _mbstrlen, _mbstrlen_l 对于多字节字符串:验证字符串中的每个字符;返回字符串的长度。For multibyte character strings: validate each character in string; return string length. 对于宽字符字符串:返回字符串长度。For wide character strings: return string length.
mbstowcs、_mbstowcs_lmbstowcs_s、_mbstowcs_s_lmbstowcs, _mbstowcs_l, mbstowcs_s, _mbstowcs_s_l 将多字节字符序列转换为对应的宽字符序列Convert sequence of multibyte characters to corresponding sequence of wide characters
mbtowc、_mbtowc_lmbtowc, _mbtowc_l 将多字节字符转换为对应的宽字符Convert multibyte character to corresponding wide character
wcstombs、_wcstombs_lwcstombs_s、_wcstombs_s_lwcstombs, _wcstombs_l, wcstombs_s, _wcstombs_s_l 将宽字符序列转换为相应的多字节字符序列Convert sequence of wide characters to corresponding sequence of multibyte characters
wctomb、_wctomb_lwctomb_s、_wctomb_s_lwctomb, _wctomb_l, wctomb_s, _wctomb_s_l 将宽字符转换为相应的多字节字符Convert wide character to corresponding multibyte character
mbrtoc16、mbrtoc32mbrtoc16, mbrtoc32 将多字节字符转换为等效 UTF-16 或 UTF-32 字符Convert multibyte character to equivalent UTF-16 or UTF-32 character
c16rtomb、c32rtombc16rtomb, c32rtomb 将 UTF-16 或 UTF-32 字符转换为等效多字节字符Convert UTF-16 or UTF-32 character to equivalent multibyte character

请参阅See Also

国际化Internationalization
按类别分的通用 C 运行时例程Universal C runtime routines by category