mbrtoc32
来自cppreference.com
该页由英文版wiki使用Google Translate机器翻译而来。
该翻译可能存在错误或用词不当。鼠标停留在文本上可以看到原版本。你可以帮助我们修正错误或改进翻译。参见说明请点击这里. |
在头文件 <cuchar> 中定义
|
||
(C11 起) | ||
一个狭窄的多字节字符转换成32位字符表示(通常情况下,UTF-32).
原文:
Converts a narrow multibyte character to its 32-bit character representation (typically, UTF-32).
如果
s
是不是一个空指针,检查n
字节的多字节字符串的开始,指向的字节s
必要去完成下一个多字节字符(包括任何移位序列)的字节数来确定。如果该函数确定下一个多字节字符s
是完整的,有效的,将其转换到对应的32位字符,并将其存储在*pc32(如果pc32
不为null)..原文:
If
s
is not a null pointer, inspects at most n
bytes of the multibyte character string, beginning with the byte pointed to by s
to determine the number of bytes necessary to complete the next multibyte character (including any shift sequences). If the function determines that the next multibyte character in s
is complete and valid, converts it to the corresponding 32-bit character and stores it in *pc32 (if pc32
is not null).如果多字节字符
*s
对应于多char32_t序列(不可能与UTF-32)后,然后给该函数的第一呼叫,*ps
更新在这样一种方式,下一个呼叫mbrtoc32
将写出来的额外char32_t ,而不考虑*s
.原文:
If the multibyte character in
*s
corresponds to a multi-char32_t sequence (not possible with UTF-32), then after the first call to this function, *ps
is updated in such a way that the next calls to mbrtoc32
will write out the additional char32_t, without considering *s
.s
是一个空指针,n
和pc32
将被忽略,并且调用相当于mbrtoc32(NULL, "", 1, ps).原文:
If
s
is a null pointer, the values of n
and pc32
are ignored and the call is equivalent to mbrtoc32(NULL, "", 1, ps).如果宽字符是空字符,的转换状态*ps代表的初始移位状态.
原文:
If the wide character produced is the null character, the conversion state *ps represents the initial shift state.
如果宏__STDC_UTF_32__的定义,使用此功能的32位编码是UTF-32,否则它是实现定义.
原文:
If the macro __STDC_UTF_32__ is defined, the 32-bit encoding used by this function is UTF-32, otherwise it is implementation-defined.
[编辑] 参数
pc32 | - | 得到的32位的字符将被写入的位置的指针
原文: pointer to the location where the resulting 32-bit character will be written |
s | - | 指针的多字节字符串作为输入
原文: pointer to the multibyte character string used as input |
n | - | 限制的字节数,可以检查
原文: limit on the number of bytes in s that can be examined |
ps | - | 解释的多字节字符串时使用的转换状态对象的指针
原文: pointer to the conversion state object used when interpreting the multibyte string |
[编辑] 返回值
以下适用:第一
原文:
The first of the following that applies:
- 0如果从
s
(字符转换,并存储在*pc32如果非空)是空字符原文:0 if the character converted froms
(and stored in *pc32 if non-null) was the null character - 从[1...n]成功转换的多字节字符的字节数
s
原文:the number of bytes [1...n] of the multibyte character successfully converted froms
- -3如果从多char32_t字符的下一个char32_t现已写入*pc32。在这种情况下,从输入处理无字节.原文:-3 if the next char32_t from a multi-char32_t character has now been written to *pc32. No bytes are processed from the input in this case.
- -2
n
如果下一个字节构成一个不完整的,但到目前为止,有效的多字节字符。没有被写入*pc32.原文:-2 if the nextn
bytes constitute an incomplete, but so far valid, multibyte character. Nothing is written to *pc32. - -1如果出现编码错误。没有被写入
*pc32
,EILSEQ存储在errno是不确定的值,如果*ps.原文:-1 if encoding error occurs. Nothing is written to*pc32
, the value EILSEQ is stored in errno and the value if *ps is unspecified.
[编辑] 另请参阅
(C11) |
一个32位的宽字符转换成多字节字符串缩小 原文: convert a 32-bit wide character to narrow multibyte string (函数) |
C++ documentation for mbrtoc32
|