Multibyte Character Functions

Top  Previous  Next

The ANSI standard allows the character set to include multibyte characters that may have state-dependent coding, in that a sequence of multibyte characters may include shift characters that alter the interpretation of subsequent characters in the sequence. Each multibyte sequence always starts in the same initial shift state.

 

A multibyte character may be extracted from such a sequence and converted into a single wide character, which is of type wchar_t (defined in stddef.h ).

The encoding of multibyte characters depends on the current locale. In Diamond, only the locales "" and "C" are implemented. A multibyte character is always a single char, and wchar_t is identical to the char data type. There is no state-dependent coding.

 


mblen

returns width of a multibyte character


mbtowc

convert a multibyte character to a wide character


wctomb

convert wide character to multibyte character