GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing cplusplus.com — mbrtoc16 Reference
function
<cuchar>
mbrtoc16size_t mbrtoc16 ( char16_t * pc16, const char * pmb, size_t max, mbstate_t * ps); Convert multibyte sequence to 16-bit character
If the __STD_UTF_16__ macro is defined, the resulting character stored at pc16 follows UTF-16 encoding. The function uses (and updates) the shift state described by ps. If ps is a null pointer, the function uses its own internal shift state, which is altered as necessary only by calls to this function. If the character obtained is equivalent to the null 16-bit character, the function resets the shift state and returns zero (after storing the null 16-bit character at pc16). A call to the function with a null pointer as pmb also resets the shift state, ignoring parameters pc16 and max (no character is stored at pc16). This is the char16_t version of mbrtowc (<cwchar>). Parameters
Return ValueThe number of bytes from pmb used to produce the 16-bit character.If this was the null 16-bit character, or if pmb is a null pointer, the function returns zero (in the first case, the null 16-bit character is stored at pc16). If the multibyte sequence needs more than one char16_t to be represented and not all have yet been stored, the function returns (size_t)-3 after storing the appropriate shift character at pc16. The next call to this function with the same ps argument pointing to the same address as pmb shall produce the next character in the sequence of char16_t characters needed to represent the multibyte sequence. If the max first characters of pmb form an incomplete (but potentially valid) multibyte character, the function returns (size_t)-2 (no value is stored at pc16). Otherwise, if the characters pointed by pmb do not form a valid multibyte character (or the beginning of one), the function returns (size_t)-1 and sets errno to EILSEQ (no value is stored at pc16). Notice that size_t is an unsigned integral type, and thus none of the values possibly returned is less than zero. See also
Home page | Privacy policy
© cplusplus.com, 2000-2026 - All rights reserved - v3.3.4s Spotted an error? contact us |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |