wcsrtombs(3) Library Functions Manual wcsrtombs(3) NOMBRE wcsrtombs - convierte una cadena de caracteres anchos a una cadena multibyte BIBLIOTECA Biblioteca Estandar C (libc, -lc) SINOPSIS #include size_t wcsrtombs(char dest[restrict .size], const wchar_t **restrict src, size_t size, mbstate_t *restrict ps); DESCRIPCION If dest is not NULL, the wcsrtombs() function converts the wide-character string *src to a multibyte string starting at dest. At most size bytes are written to dest. The shift state *ps is updated. The conversion is effectively performed by repeatedly calling wcrtomb(dest, *src, ps), as long as this call succeeds, and then incrementing dest by the number of bytes written and *src by one. 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, *src se deja apuntando al caracter ancho invalido, se devuelve (size_t) -1 y errno toma el valor EILSEQ. o The size limit forces a stop. In this case, *src is left pointing to the next wide character to be converted, and the number of bytes written to dest is returned. o The wide-character string has been completely converted, including the terminating null wide character (L'\0'), which has the side effect of bringing back *ps to the initial state. In this case, *src is set to NULL, and the number of bytes written to dest, excluding the terminating null byte ('\0'), is returned. If dest is NULL, size is ignored, and the conversion proceeds as above, except that the converted bytes are not written out to memory, and that no size limit exists. En los dos casos anteriores, si ps es un puntero NULL se usa en su lugar un estado estatico anonimo solo conocido por la funcion wcsrtombs(). The programmer must ensure that there is room for at least size bytes at dest. VALOR DEVUELTO La funcion wcsrtombs() 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 y errno toma el valor EILSEQ. ATRIBUTOS Para obtener una explicacion de los terminos usados en esta seccion, vease attributes(7). +------------+--------------------+------------------------------------+ |Interfaz | Atributo | Valor | +------------+--------------------+------------------------------------+ |wcsrtombs() | Seguridad del hilo | MT-Carrera insegura:wcsrtombs/!ps | +------------+--------------------+------------------------------------+ ESTANDARES C11, POSIX.1-2008. HISTORIAL POSIX.1-2001, C99. NOTAS El comportamiento de wcsrtombs() depende de la categoria LC_CTYPE de la localizacion actual. Pasar NULL como valor de ps no es seguro en un entorno multihilos. VEASE TAMBIEN iconv(3), mbsinit(3), wcrtomb(3), wcsnrtombs(3), wcstombs(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 . Paginas de Manual de Linux 6.12 17 Noviembre 2024 wcsrtombs(3)