*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->NetBSD man pages -> wctomb (3)              
Title
Content
Arch
Section
 

WCTOMB(3)

Contents


NAME    [Toc]    [Back]

     wctomb - converts a wide character to a multibyte character

LIBRARY    [Toc]    [Back]

     Standard C Library (libc, -lc)

SYNOPSIS    [Toc]    [Back]

     #include <stdlib.h>

     int
     wctomb(char * s, const wchar_t wchar);

DESCRIPTION    [Toc]    [Back]

     The wctomb() converts the wide character wchar to the corresponding
     multibyte character, and store it to the array pointed by s.  The
     wctomb() may store at most MB_CUR_MAX bytes to the array.

     In state-dependent encoding, the wctomb() may store the special sequence
     to change the conversion state before an actual multibyte character into
     the array pointed s.  If wchar is null wide character (L'\0'), this function
 places its own internal state to an initial conversion state.

     Calling any other functions in the Standard C Library (libc, -lc) never
     change the internal state of the wctomb(), except for calling
     setlocale(3) with changing LC_CTYPE category of the current locale.  Such
     setlocale(3) call causes the internal state of this function to be indeterminate.


     The behaviour of the wctomb() is affected by LC_CTYPE category of the
     current locale.

     There is a special case:

     s == NULL     wctomb() initializes its own internal state to an initial
                   state, and determines whether the current encoding is
                   state-dependent.  This function returns 0 if the encoding
                   is state-independent, otherwise non-zero.  In this case,
                   wchar is completely ignored.

RETURN VALUES    [Toc]    [Back]

     In the usual case, the wctomb() returns:

     positive      number of bytes for the valid multibyte character pointed
                   by s.  There is no cases that the value returned is greater
                   than n or the value of MB_CUR_MAX macro.

     -1            wchar is an invalid wide character.

     In the case that s is equal to NULL, the mbtowc() returns:

     0           The current encoding is state-independent.

     non-zero    The current encoding is state-dependent.

ERRORS    [Toc]    [Back]

     No errors are defined.

SEE ALSO    [Toc]    [Back]

      
      
     setlocale(3)

STANDARDS    [Toc]    [Back]

     The wctomb() function conforms to ANSI X3.159-1989 (``ANSI C'').

BSD                            February 3, 2002                            BSD
[ Back ]
 Similar pages
Name OS Title
mbrtowc NetBSD converts a multibyte character to a wide character (restartable)
wcrtomb NetBSD converts a wide character to a multibyte character (restartable)
mbtowc NetBSD converts a multibyte character to a wide character
mbsrtowcs NetBSD converts a multibyte character string to a wide character string (restartable)
wcsrtombs NetBSD converts a wide character string to a multibyte character string (restartable)
wcstombs NetBSD converts a wide character string to a multibyte character string
mbstowcs NetBSD converts a multibyte character string to a wide character string
mbrtowc Tru64 Convert a multibyte character to a wide character
mbtowc Tru64 Convert a multibyte character to a wide character
wctomb Tru64 Convert a wide character into a multibyte character
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service