multibyte(3c) DG/UX 4.30 multibyte(3c)
NAME
mblen, mbtowc, wctomb, mbstowcs, wcstombs - multibyte
operations
SYNOPSIS
int mblen(s, n)
char *s;
sizet n;
int mbtowc(pwc, s, n)
wchart *pwc;
char *s;
sizet n;
int wctomb(s, wchar)
char *s;
wchart wchar;
sizet mbstowcs(pwcs, s n)
wchart *pwcs;
char *s;
sizet n;
sizet wcstombs(s, pwcs, n)
char *s;
wchart *pwcs;
sizet n;
DESCRIPTION
If s is a NULL pointer, mblen, mbtowc, and wctomb return
nonzero if multibyte character encodings have state-
dependent encodings, otherwise zero. For state-dependent
encodings, each of these functions is placed in its initial
state when called with s as a NULL pointer; the internal
state of the function is altered as necessary on subsequent
calls with non-NULL s.
If s is not a NULL pointer, these functions operate as
follows:
Mblen returns the number of bytes in the multibyte character
pointed to by s (zero for the null character), or -1 if the
next n or fewer bytes do not form a valid multibyte
character.
Mbtowc examines at most n bytes of the object pointed to by
s. If s points to a valid multibyte character, mbtowc
stores the wide-character code for that character in the
object pointed to by pwc. Mbtowc returns the number of
bytes in the multibyte character (zero for the null
character) at s, or -1 if s does not point to a valid
multibyte character.
Licensed material--property of copyright holder(s) Page 1
multibyte(3c) DG/UX 4.30 multibyte(3c)
Wctomb converts the wide-character code wchar to its
multibyte representation (including any change in shift
state), and stores that representation in the object pointed
to by s. Wctomb returns the number of bytes in the
multibyte character, or -1 if wchar does not correspond to a
valid multibyte character.
Mbtowc converts a sequence of multibyte characters
(beginning in the initial shift state) from string s and
stores at most n corresponding codes into array pwcs. If a
null character is encountered in s, it is converted into a
zero-valued code and the conversion is terminated.
Mbtowc returns the number of array elements modified
(excluding any terminating zero code), or (sizet)-1 if an
invalid multibyte character is encountered.
Wcstombs converts a sequence of wide-character codes from
array pcws into a sequence of multibyte characters
(beginning in the initial shift state) and stores these
characters into string s. The conversion terminates when a
null character is stored, or when a multibyte character
would exceed the limit of n total bytes.
Wcstombs returns the number of bytes modified in s
(excluding a terminating null character), or (sizet)-1 if
an invalid wide-character code is encountered.
NOTES
The behavior of these functions is affected by the LC_CTYPE
category of the current locale.
SEE ALSO
locale(3c).
Licensed material--property of copyright holder(s) Page 2