Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
MBRTOWC(3)		 BSD Library Functions Manual		    MBRTOWC(3)

NAME
     mbrtowc --	convert	a character to a wide-character	code (restartable)

LIBRARY
     Standard C	Library	(libc, -lc)

SYNOPSIS
     #include <wchar.h>

     size_t
     mbrtowc(wchar_t * restrict	pwc, const char	* restrict s, size_t n,
	 mbstate_t * restrict ps);

DESCRIPTION
     The mbrtowc() function inspects at	most n bytes pointed to	by s and in-
     terprets them as a	multibyte character sequence according to the current
     setting of	LC_CTYPE.  If pwc is not NULL, the multibyte character which s
     represents	is stored in the wchar_t it points to.

     If	s is NULL, mbrtowc() behaves as	if pwc was NULL, s was an empty	string
     ("") and n	was 1.

     The mbstate_t argument, ps, is used to keep track of the shift state.  If
     it	is NULL, mbrtowc() uses	an internal, static mbstate_t object.

RETURN VALUES
     The mbrtowc() functions returns:

     0	     The first n or fewer bytes	of s represent the null	wide character
	     (L'\0').

     >0	     The first n or fewer bytes	of s represent a valid character,
	     mbrtowc() returns the length (in bytes) of	the multibyte se-
	     quence.

     (size_t)-2
	     The first n bytes of s are	an incomplete multibyte	sequence.

     (size_t)-1
	     The byte sequence pointed to by s is an invalid multibyte se-
	     quence.

ERRORS
     The mbrtowc() function will fail if:

     [EILSEQ]		An invalid multibyte sequence was detected.

SEE ALSO
     mbtowc(3),	setlocale(3), wcrtomb(3)

STANDARDS
     The mbrtowc() function conforms to	ISO/IEC	9899:1999 ("ISO	C99").

BUGS
     The current implementation	does not support shift states.

BSD				August 15, 2002				   BSD

NAME | LIBRARY | SYNOPSIS | DESCRIPTION | RETURN VALUES | ERRORS | SEE ALSO | STANDARDS | BUGS

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=mbrtowc&sektion=3&manpath=FreeBSD+5.2-RELEASE+and+Ports>

home | help