mbrlen
来自cppreference.com
|
|
该页由英文版wiki使用Google Translate机器翻译而来。
该翻译可能存在错误或用词不当。鼠标停留在文本上可以看到原版本。你可以帮助我们修正错误或改进翻译。参见说明请点击这里. |
| 在头文件 <wchar.h> 中定义
|
||
确定文件的大小(以字节为单位),其余的多字节字符的第一个字节指出,
s,鉴于目前的转换状态ps原文:
Determines the size, in bytes, of the remainder of the multibyte character whose first byte is pointed to by
s, given the current conversion state ps.此函数等同类型mbrtowc(nullptr, s, n, ps?ps:&internal)一些隐藏的对象
internal的号召mbstate_t,除了表达ps只计算一次.目录 |
[编辑] 参数
| s | - | 元素的多字节字符串的指针
原文: pointer to an element of a multibyte character string |
| n | - | 限制的字节数,可以检查
原文: limit on the number of bytes in s that can be examined |
| ps | - | 指针的变量转换状态
原文: pointer to the variable holding the conversion state |
[编辑] 返回值
0如果下一个
n或更少的字节完成空字符.原文:
0 if the next
n or fewer bytes complete the null character.完成一个有效的多字节字符的字节数(1和n)
原文:
The number of bytes (between 1 and n) that complete a valid multibyte character
(size_t)-1如果出现编码错误
(size_t)-2
n如果下一个字节是可能有效的多字节字符,它仍然是不完整的后检查所有n字节的一部分原文:
(size_t)-2 if the next
n bytes are part of a possibly valid multibyte character, which is still incomplete after examining all n bytes[编辑] 示例
| 本章尚未完成 原因:暂无示例 |
[编辑] 另请参阅
| 下的多字节字符转换为宽字符,给定的状态中 原文: converts the next multibyte character to wide character, given state (函数) | |
| 在未来的多字节字符,返回的字节数 原文: returns the number of bytes in the next multibyte character (函数) | |
| C++ documentation for mbrlen
| |