| Functions | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Wide/multibyte conversions | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
(C95) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Types | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Macros | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Defined in header <uchar.h> | ||
| (since C23) | ||
Converts a narrow multibyte character to UTF-8 encoding.
Ifs is not a null pointer, inspects at mostn bytes of the multibyte character string, beginning with the byte pointed to bys 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 ins is complete and valid, converts it to UTF-8 and stores the first UTF-8 code unit in*pc8 (ifpc8 is not null).
If UTF-8 encoding of the multibyte character in*s consists of more than one UTF-8 code unit, then after the first call to this function,*ps is updated in such a way that the next call tombrtoc8 will write out the additional UTF-8 code units, without considering*s.
Ifs is a null pointer, the values ofn andpc8 are ignored and the call is equivalent tombrtoc8(nullptr,"",1, ps).
If UTF-8 code unit produced isu8'\0', the conversion state*ps represents the initial shift state.
The multibyte encoding used by this function is specified by the currently active C locale.
Contents |
| pc8 | - | pointer to the location where the resulting UTF-8 code units 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:
[1, n] of the multibyte character successfully converted froms.| This section is incomplete Reason: no example |
(C23) | converts UTF-8 string to narrow multibyte encoding (function)[edit] |
C++ documentation formbrtoc8 | |