'\"macro stdmacro
.if n .pH g3c.mbstring @(#)mbstring	40.15 of 10/27/89
.\" Copyright 1989 AT&T
'\"macro stdmacro
.if n .pH g3c.mbstring 'ident	"@(#)ccsman:g3c/mbstring	1.1"'
.nr X
.if \nX=0 .ds x} mbstring 3C "C Programming Language Utilities" "\&"
.if \nX=1 .ds x} mbstring 3C "C Programming Language Utilities"
.if \nX=2 .ds x} mbstring 3C "" "\&"
.if \nX=3 .ds x} mbstring "" "" "\&"
.TH \*(x}
.SH NAME
\f4mbstring\f1: \f4mbstowcs\f1, \f4wcstombs\f1 \- multibyte string functions
.SH SYNOPSIS
\f4#include <stdlib.h>\f1
.PP
\f4size_t mbstowcs (wchar_t \(**pwcs, const char \(**s, size_t n);\f1
.PP
\f4size_t wcstombs (char \(**s, const wchar_t \(**pwcs, size_t n);\f1
.SH DESCRIPTION
.PP
\f4mbstowcs\fP converts a sequence of multibyte characters from the
array pointed to by \f2s\f1 into a sequence of corresponding wide
character codes and stores these codes into the array pointed to by
\f2pwcs\f1, stopping after \f2n\f1 codes are stored or a code with value
zero (a converted
null
character) is stored.
If an invalid multibyte character is encountered, \f4mbstowcs\fP returns
(\f4size_t\f1)\-1.
Otherwise, \f4mbstowcs\fP returns
the number of array elements modified, not
including the terminating zero code, if any.
.PP
\f4wcstombs\fP converts a sequence of wide character codes from the array
pointed to by \f2pwcs\f1 into a sequence of multibyte characters and
stores these multibyte characters into the array pointed to by \f2s\f1,
stopping if a multibyte character would exceed the limit of \f2n\f1 total
bytes or if a
null
character is stored.
If a wide character code is
encountered that does not correspond to a valid multibyte character,
\f4wcstombs\fP returns (\f4size_t\f1)\-1.
Otherwise, \f4wcstombs\fP returns
the number of bytes modified, not including a terminating
null
character,
if any.
.SH "SEE ALSO"
\f4mbchar\fP(3C), \f4setlocale\fP(3C), \f4environ\f1(5).
.br
\f4chrtbl\fP(1M) in the \f2System Administrator's Reference Manual\f1.
.\"	@(#)mbchar.3c	
.Ee
