.\" -*- coding: UTF-8 -*- '\" t .\" Copyright, Bruno Haible .\" Copyright, the authors of the Linux man-pages project .\" .\" SPDX-License-Identifier: GPL-2.0-or-later .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH wcstombs 3 "8 Febrero 2026" "Linux man\-pages 6.18" .SH NOMBRE wcstombs \- convierte una cadena de caracteres anchos a una cadena mulibyte .SH BIBLIOTECA Biblioteca Estándar C (\fIlibc\fP,\ \fI\-lc\fP) .SH SINOPSIS .nf \fB#include \fP .P \fBsize_t wcstombs(\fPsize_t dsize; \fB char \fP\fIdest\fP\fB[restrict \fP\fIdsize\fP\fB], const wchar_t *restrict \fP\fIsrc\fP\fB,\fP \fB size_t \fP\fIdsize\fP\fB);\fP .fi .SH DESCRIPCIÓN If \fIdest\fP is not NULL, the \fBwcstombs\fP() function converts the wide\-character string \fIsrc\fP to a multibyte string starting at \fIdest\fP. At most \fIdsize\fP bytes are written to \fIdest\fP. The sequence of characters placed in \fIdest\fP begins in the initial shift state. The conversion can stop for three reasons: .IP \[bu] 3 Se ha encontrado un carácter ancho que no se puede representar como una secuencia multibyte (de acuerdo con la localización actual). En este caso se devuelve \fI(size_t)\ \-1\fP. .IP \[bu] El límite de longitud fuerza la parada. En este caso, devuelve el número de bytes escritos en \fIdest\fP pero el estado de cambios en este punto se pierde. .IP \[bu] The wide\-character string has been completely converted, including the terminating null wide character (L\[aq]\[rs]0\[aq]). In this case, the conversion ends in the initial shift state. The number of bytes written to \fIdest\fP, excluding the terminating null byte (\[aq]\[rs]0\[aq]), is returned. .P The programmer must ensure that there is room for at least \fIdsize\fP bytes at \fIdest\fP. .P If \fIdest\fP is NULL, \fIdsize\fP is ignored, and the conversion proceeds as above, except that the converted bytes are not written out to memory, and no length limit exists. .P In order to avoid the case 2 above, the programmer should make sure \fIdsize\fP is greater than or equal to \fIwcstombs(NULL,src,0)+1\fP. .SH "VALOR DEVUELTO" La función \fBwcstombs\fP() devuelve el número de bytes que conforman la parte de la secuencia multibyte convertida, sin incluir el byte nulo terminador. Si encontró un carácter ancho que no pudo convertir, devuelve \fI(size_t)\ \-1\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 \fBwcstombs\fP() T} Seguridad del hilo Multi\-hilo seguro .TE .SH VERSIONES La función \fBwcsrtombs\fP(3) proporciona un interfaz seguro para hilos con la misma funcionalidad. .SH ESTÁNDARES C11, POSIX.1\-2008. .SH HISTORIAL POSIX.1\-2001, C99. .SH NOTAS El comportamiento de \fBwcstombs\fP() depende de la categoría \fBLC_CTYPE\fP de la localización actual. .SH "VÉASE TAMBIÉN" \fBmblen\fP(3), \fBmbstowcs\fP(3), \fBmbtowc\fP(3), \fBwcsrtombs\fP(3), \fBwctomb\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 y Juan Piernas . .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 .