Namespaces
Variants
Views
Actions

std::mbrtoc16

From cppreference.com
< cpp‎ | string‎ | multibyte
Revision as of 12:16, 26 December 2011 by Cubbi (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Template:cpp/string/multibyte/sidebar

Defined in header <cuchar>
std::size_t mbrtoc32( char32_t* pc16,

                      const char* s,
                      std::size_t n,

                      std::mbstate_t* ps);
(since C++11)

Converts a narrow multibyte character to its 32-bit character representation (typically, UTF-32).

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 Template:cpp (if pc32 is not null).

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.

If s is a null pointer, the values of n and pc32 are ignored and the call is equivalent to Template:cpp.

If the wide character produced is the null character, the conversion state Template:cpp represents the initial shift state.

If the macro Template:cpp is defined, the 32-bit encoding used by this function is UTF-32, otherwise it is implementation-defined.

Parameters

pc32 - 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

Return value

The first of the following that applies:

See also

Template:cpp/string/multibyte/dcl list c32rtombTemplate:cpp/locale/codecvt/dcl list do in