wcstombs(3) Library Functions Manual wcstombs(3) NOMBRE wcstombs - convierte una cadena de caracteres anchos a una cadena mulibyte BIBLIOTECA Biblioteca Estandar C (libc, -lc) SINOPSIS #include size_t wcstombs(size_t dsize; char dest[restrict dsize], const wchar_t *restrict src, size_t dsize); DESCRIPCION If dest is not NULL, the wcstombs() function converts the wide-character string src to a multibyte string starting at dest. At most dsize bytes are written to dest. The sequence of characters placed in dest begins in the initial shift state. The conversion can stop for three reasons: o Se ha encontrado un caracter ancho que no se puede representar como una secuencia multibyte (de acuerdo con la localizacion actual). En este caso se devuelve (size_t) -1. o El limite de longitud fuerza la parada. En este caso, devuelve el numero de bytes escritos en dest pero el estado de cambios en este punto se pierde. o The wide-character string has been completely converted, including the terminating null wide character (L'\0'). In this case, the conversion ends in the initial shift state. The number of bytes written to dest, excluding the terminating null byte ('\0'), is returned. The programmer must ensure that there is room for at least dsize bytes at dest. If dest is NULL, dsize is ignored, and the conversion proceeds as above, except that the converted bytes are not written out to memory, and no length limit exists. In order to avoid the case 2 above, the programmer should make sure dsize is greater than or equal to wcstombs(NULL,src,0)+1. VALOR DEVUELTO La funcion wcstombs() devuelve el numero de bytes que conforman la parte de la secuencia multibyte convertida, sin incluir el byte nulo terminador. Si encontro un caracter ancho que no pudo convertir, devuelve (size_t) -1. ATRIBUTOS Para obtener una explicacion de los terminos usados en esta seccion, vease attributes(7). +-----------------------------+--------------------+-------------------+ |Interfaz | Atributo | Valor | +-----------------------------+--------------------+-------------------+ |wcstombs() | Seguridad del hilo | Multi-hilo seguro | +-----------------------------+--------------------+-------------------+ VERSIONES La funcion wcsrtombs(3) proporciona un interfaz seguro para hilos con la misma funcionalidad. ESTANDARES C11, POSIX.1-2008. HISTORIAL POSIX.1-2001, C99. NOTAS El comportamiento de wcstombs() depende de la categoria LC_CTYPE de la localizacion actual. VEASE TAMBIEN mblen(3), mbstowcs(3), mbtowc(3), wcsrtombs(3), wctomb(3) TRADUCCION La traduccion al espanol de esta pagina del manual fue creada por Pedro Pablo Fabrega y Juan Piernas Esta traduccion es documentacion libre; lea la GNU General Public License Version 3 o posterior con respecto a las condiciones de copyright. No existe NINGUNA RESPONSABILIDAD. Si encuentra algun error en la traduccion de esta pagina del manual, envie un correo electronico a . Linux man-pages 6.18 8 Febrero 2026 wcstombs(3)