Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/w/wctomb.html on line 1

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/w/wctomb.html on line 1

Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/w/wctomb.html on line 8

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/w/wctomb.html on line 8

wctomb()

Convert a wide character into a multibyte character

Synopsis:

#include <stdlib.h>
int wctomb( char * s, 
            wchar_t wc );

Arguments:

s
NULL, or a pointer to a location where the function can store the multibyte character.
wc
The wide character that you want to convert.

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.

Description:

The wctomb() function determines the number of bytes required to represent the multibyte character corresponding to the code contained in wc. If s isn't NULL, the multibyte character representation is stored in the array it points to. At most MB_CUR_MAX characters are stored.

Returns:

Examples:

#include <stdio.h>
#include <stdlib.h>

wchar_t wchar = { 0x0073 };
char    mbbuffer[MB_CUR_MAX];

int main( void )
  {
    int len;

    printf( "Character encodings do %shave "
        "state-dependent \nencoding.\n",
        ( wctomb( NULL, 0 ) )
        ? "" : "not " );

    len = wctomb( mbbuffer, wchar );
    mbbuffer[len] = '\0';
    printf( "%s(%d)\n", mbbuffer, len );
    return EXIT_SUCCESS;
  }

This produces the output:

Character encodings do not have state-dependent 
encoding.
s(1)

Classification:

ANSI, POSIX 1003.1

Safety:
Cancellation point No
Interrupt handler No
Signal handler Yes
Thread Yes

See also:

wcrtomb(), wcsrtombs(), wcstod(), wcstof(), wcstold(), wcstoimax(), wcstoumax(), wcstok(), wcstol(), wcstoll(), wcstombs(), wcstoul(), wcstoull(), wctob()


Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/w/wctomb.html on line 188

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/w/wctomb.html on line 188