.\" -*- coding: UTF-8 -*- '\" t .\" Copyright (c) Bruno Haible .\" .\" SPDX-License-Identifier: GPL-2.0-or-later .\" .\" References consulted: .\" GNU glibc-2 source code and manual .\" Dinkumware C library reference http://www.dinkumware.com/ .\" OpenGroup's Single UNIX specification http://www.UNIX-systems.org/online.html .\" ISO/IEC 9899:1999 .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH wcrtomb 3 "20 ​​Julio 2023" "Páginas de manual de Linux 6.05.01" .SH NOMBRE wcrtomb \- convierte una carácter ancho a un secuencia multibyte .SH BIBLIOTECA Biblioteca Estándar C (\fIlibc\fP, \fI\-lc\fP) .SH SINOPSIS .nf \fB#include \fP .PP \fBsize_t wcrtomb(char *restrict \fP\fIs\fP\fB, wchar_t \fP\fIwc\fP\fB, mbstate_t *restrict \fP\fIps\fP\fB);\fP .fi .SH DESCRIPCIÓN The main case for this function is when \fIs\fP is not NULL and \fIwc\fP is not a null wide character (L\[aq]\e0\[aq]). In this case, the \fBwcrtomb\fP() function converts the wide character \fIwc\fP to its multibyte representation and stores it at the beginning of the character array pointed to by \fIs\fP. It updates the shift state \fI*ps\fP, and returns the length of said multibyte representation, that is, the number of bytes written at \fIs\fP. .PP A different case is when \fIs\fP is not NULL, but \fIwc\fP is a null wide character (L\[aq]\e0\[aq]). In this case, the \fBwcrtomb\fP() function stores at the character array pointed to by \fIs\fP the shift sequence needed to bring \fI*ps\fP back to the initial state, followed by a \[aq]\e0\[aq] byte. It updates the shift state \fI*ps\fP (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 \fIs\fP. .PP Un tercer caso es cuando \fIs\fP es NULL. En este caso \fIwc\fP se ignora, y la función devuelve efectivamente .PP .in +4n .EX wcrtomb(buf, L\[aq]\e0\[aq], ps) .EE .in .PP donde \fIbuf\fP es un buffer anónimo interno. .PP En todos los casos anteriores, si \fIps\fP es un puntero NULL, se usa en su lugar un estado estático anónimo sólo conocido por la función \fBwcrtomb\fP(). .SH "VALOR DEVUELTO" La función \fBwcrtomb\fP() devuelve el número de bytes que han sido o serían escritos en el array de bytes \fIs\fP. Si \fIwc\fP no se puede representar como un secuencia multibyte (de acuerdo a la localización actual), devuelve \fI(size_t)\ \-1\fP y \fIerrno\fP se pone con el valor \fBEILSEQ\fP. .SH ATRIBUTOS Para obtener una explicación de los términos usados en esta sección, véase \fBattributes\fP(7). .TS allbox; lbx lb lb l l l. Interfaz Atributo Valor T{ .na .nh \fBwcrtomb\fP() T} Seguridad del hilo MT\-Unsafe race:wcrtomb/!ps .TE .sp 1 .SH ESTÁNDARES C11, POSIX.1\-2008. .SH HISTORIAL POSIX.1\-2001, C99. .SH NOTAS El comportamiento de \fBwcrtomb\fP() depende de la categoría \fBLC_CTYPE\fP de la localización actual. .PP Pasar NULL como valor de \fIps\fP no es seguro en un entorno multihilos. .SH "VÉASE TAMBIÉN" \fBmbsinit\fP(3), \fBwcsrtombs\fP(3) .PP .SH TRADUCCIÓN La traducción al español de esta página del manual fue creada por Pedro Pablo Fábrega , Juan Piernas y Marcos Fouces . .PP Esta traducción es documentación libre; lea la .UR https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3 .UE o posterior con respecto a las condiciones de copyright. No existe NINGUNA RESPONSABILIDAD. .PP Si encuentra algún error en la traducción de esta página del manual, envíe un correo electrónico a .MT debian-l10n-spanish@lists.debian.org .ME .