wcrtomb(3) Library Functions Manual wcrtomb(3) NOMBRE wcrtomb - convierte una caracter ancho a un secuencia multibyte BIBLIOTECA Biblioteca Estandar C (libc, -lc) SINOPSIS #include size_t wcrtomb(char *restrict s, wchar_t wc, mbstate_t *restrict ps); DESCRIPCION The main case for this function is when s is not NULL and wc is not a null wide character (L'\0'). In this case, the wcrtomb() function converts the wide character wc to its multibyte representation and stores it at the beginning of the character array pointed to by s. It updates the shift state *ps, and returns the length of said multibyte representation, that is, the number of bytes written at s. A different case is when s is not NULL, but wc is a null wide character (L'\0'). In this case, the wcrtomb() function stores at the character array pointed to by s the shift sequence needed to bring *ps back to the initial state, followed by a '\0' byte. It updates the shift state *ps (i.e., brings it into the initial state), and returns the length of the shift sequence plus one, that is, the number of bytes written at s. Un tercer caso es cuando s es NULL. En este caso wc se ignora, y la funcion devuelve efectivamente wcrtomb(buf, L'\0', ps) donde buf es un buffer anonimo interno. En todos los casos anteriores, si ps es un puntero NULL, se usa en su lugar un estado estatico anonimo solo conocido por la funcion wcrtomb(). VALOR DEVUELTO La funcion wcrtomb() devuelve el numero de bytes que han sido o serian escritos en el array de bytes s. Si wc no se puede representar como un secuencia multibyte (de acuerdo a la localizacion actual), devuelve (size_t) -1 y errno se pone con el valor EILSEQ. ATRIBUTOS Para obtener una explicacion de los terminos usados en esta seccion, vease attributes(7). +--------------------+--------------------+----------------------------+ |Interfaz | Atributo | Valor | +--------------------+--------------------+----------------------------+ |wcrtomb() | Seguridad del hilo | MT-Unsafe race:wcrtomb/!ps | +--------------------+--------------------+----------------------------+ ESTANDARES C11, POSIX.1-2008. HISTORIAL POSIX.1-2001, C99. NOTAS El comportamiento de wcrtomb() 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 mbsinit(3), wcsrtombs(3) TRADUCCION La traduccion al espanol de esta pagina del manual fue creada por Pedro Pablo Fabrega , Juan Piernas y Marcos Fouces 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.06 31 Octubre 2023 wcrtomb(3)