c32rtomb
来自cppreference.com
该页由英文版wiki使用Google Translate机器翻译而来。
该翻译可能存在错误或用词不当。鼠标停留在文本上可以看到原版本。你可以帮助我们修正错误或改进翻译。参见说明请点击这里. |
在头文件 <uchar.h> 中定义
|
||
(C11 起) | ||
将其狭窄的多字节表示一个32位的宽字符.
原文:
Converts a 32-bit wide character to its narrow multibyte representation.
s
是不是一个空指针,函数的数量决定了需要存储的字节的多字节字符表示c32
(包括任何移位序列),和存储多字节字符表示的字符数组,该数组的第一个元素是指向s
。通过此功能可以写在最MB_CUR_MAX字节.原文:
If
s
is not a null pointer, the function determines the number of bytes necessary to store the multibyte character representation of c32
(including any shift sequences), and stores the multibyte character representation in the character array whose first element is pointed to by s
. At most MB_CUR_MAX bytes can be written by this function.s
是一个空指针,调用等效c32rtomb(buf, U'\0', ps)一些内部缓冲区buf
.原文:
If
s
is a null pointer, the call is equivalent to c32rtomb(buf, U'\0', ps) for some internal buffer buf
.如果
c32
是空宽字符U'\0'的,一个空字节存储,在此之前通过必要的任何变化序列,恢复初始移位状态的更新和转换状态参数*ps代表初始位移状态的.原文:
If
c32
is the null wide character U'\0', a null byte is stored, preceded by any shift sequence necessary to restore the initial shift state and the conversion state parameter *ps is updated to represent the initial shift state.如果宏__STDC_UTF_32__的定义,使用此功能的32位编码是UTF-32,否则它是实现定义的。在任何情况下,使用此功能指定多字节编码由目前活跃的C语言环境.
原文:
If the macro __STDC_UTF_32__ is defined, the 32-bit encoding used by this function is UTF-32, otherwise it is implementation-defined. In any case, the multibyte encoding used by this function is specified by the currently active C locale.
[编辑] 参数
s | - | 窄字符数组的多字节字符将被存储的指针
原文: pointer to narrow character array where the multibyte character will be stored |
c32 | - | 32位字符进行转换
|
ps | - | 解释的多字节字符串时使用的转换状态对象的指针
原文: pointer to the conversion state object used when interpreting the multibyte string |
[编辑] 返回值
如果成功,则返回的字节数(包括任何移位序列)写入的字符数组,该数组的第一个元素是指向
s
。此值可为0,例如当处理多char32_t字符序列(不发生在UTF-32)中的第一char32_t.原文:
On success, returns the number of bytes (including any shift sequences) written to the character array whose first element is pointed to by
s
. This value may be 0, e.g. when processing the first char32_t in multi-char32_t-character sequence (does not occur in UTF-32).失败(如果c32是不是一个有效的32位字符),返回-1,店EILSEQerrno不明确的状态,并留下*ps.
原文:
On failure (if c32 is not a valid 32-bit character), returns -1, stores EILSEQ in errno, and leaves *ps in unspecified state.
[编辑] 另请参阅
(C11) |
产生下一个32位宽从一个狭窄的多字节字符串的字符 原文: generate the next 32-bit wide character from a narrow multibyte string (函数) |
C++ documentation for c32rtomb
|