Provided by: manpages-es-dev_4.13-4_all bug

NOMBRE

       iconv - realiza la conversión del conjunto de caracteres

SINOPSIS

       #include <iconv.h>

       size_t iconv(iconv_t cd,
                    char **inbuf, size_t *inbytesleft,
                    char **outbuf, size_t *outbytesleft);

DESCRIPCIÓN

       The  iconv()   function  converts  a  sequence  of  characters in one character encoding to a sequence of
       characters in another character encoding.  The cd argument is a conversion descriptor, previously created
       by a call to iconv_open(3); the conversion descriptor defines the character encodings that iconv()   uses
       for  the  conversion.  The inbuf argument is the address of a variable that points to the first character
       of the input sequence; inbytesleft indicates the number of bytes in that buffer.  The outbuf argument  is
       the  address  of  a  variable  that points to the first byte available in the output buffer; outbytesleft
       indicates the number of bytes available in the output buffer.

       El principal caso se da cuando inbuf es distinto de NULL y *inbuf es distinto de NULL.  En este caso,  la
       función  iconv()  convierte  la secuencia multibyte que comienza en *inbuf en una secuencia multibyte que
       comenzará en *outbuf.  Como mucho se leerán *inbytesleft bytes, comenzando  en  *inbuf.   Como  mucho  se
       escribirán *outbytesleft bytes, comenzando en *outbuf.

       The  iconv()   function  converts one multibyte character at a time, and for each character conversion it
       increments *inbuf and decrements *inbytesleft by the number  of  converted  input  bytes,  it  increments
       *outbuf  and  decrements  *outbytesleft  by  the  number  of  converted  output bytes, and it updates the
       conversion state contained in cd.  If the character encoding  of  the  input  is  stateful,  the  iconv()
       function  can  also  convert  a  sequence  of  input  bytes  to an update to the conversion state without
       producing any output bytes; such input is called a shift sequence.  The  conversion  can  stop  for  four
       reasons:

       1. Se  encontró  una  secuencia multibyte inválida en la entrada. En este caso se asigna a errno el valor
          EILSEQ y se devuelve (size_t) -1. *inbuf se deja apuntando al  principio  de  la  secuencia  multibyte
          inválida.

       2. La  secuencia de bytes de entrada ha sido totalmente convertida, esto es, *inbytesleft ha llegado a 0.
          En este caso iconv() devuelve el número  de  conversiones  no  recuperables  realizadas  durante  esta
          llamada.

       3. Se  encontró  una  secuencia  multibyte  incompleta  en la entrada, y la secuencia de bytes de entrada
          termina después de ella. En este caso se asigna a errno el valor EINVAL  y  se  devuelve  (size_t) -1.
          *inbuf se deja apuntando al principio de la secuencia multibyte incompleta.

       4. El buffer de salida no tiene suficiente espacio para el siguiente carácter convertido. En este caso se
          asigna a errno el valor E2BIG y se devuelve (size_t) -1.

       Un  caso diferente es cuando inbuf es NULL o *inbuf es NULL, pero outbuf no es NULL y *outbuf no es NULL.
       En este caso, la función iconv() intenta poner el estado de conversión de  cd  en  el  estado  inicial  y
       almacenar  una  secuencia  de  cambios correspondiente en *outbuf.  Como mucho se ecribirán *outbytesleft
       bytes, comenzando en *outbuf.  Si el buffer de salida  se  queda  sin  espacio  para  esta  secuencia  de
       reinicio,  la  función  asigna  a  errno  el  valor E2BIG y devuelve (size_t) -1. En otro caso incrementa
       *outbuf y decrementa *outbytesleft con el número de bytes escritos.

       Un tercer caso es cuando inbuf es NULL o *inbuf es NULL, y outbuf es NULL o  *outbuf  es  NULL.  En  este
       caso, la función iconv() pone el estado de conversión de cd en el estado inicial.

VALOR DEVUELTO

       La  función  iconv()  devuelve  el  número  de caracteres convertidos de manera no-recuperable durante la
       llamada; las conversiones recuperables no se cuentan.  En caso de error,  modifica  errno  con  un  valor
       apropiado y devuelve (size_t) -1.

ERRORES

       Pueden ocurrir los siguientes errores, entre otros:

       E2BIG  No hay suficiente espacio en *outbuf.

       EILSEQ Se encontró una secuencia multibyte inválida a la entrada.

       EINVAL Se encontró una secuencia multibyte incompleta a la entrada.

VERSIONES

       This function is available in glibc since version 2.1.

ATRIBUTOS

       Para obtener una explicación de los términos usados en esta sección, véase attributes(7).
       ┌──────────┬────────────────────┬─────────────────┐
       │ InterfazAtributoValor           │
       ├──────────┼────────────────────┼─────────────────┤
       │ iconv()  │ Seguridad del hilo │ MT-Safe race:cd │
       └──────────┴────────────────────┴─────────────────┘

       The iconv()  function is MT-Safe, as long as callers arrange for mutual exclusion on the cd argument.

CONFORME A

       POSIX.1-2001, POSIX.1-2008.

NOTAS

       In  each  series of calls to iconv(), the last should be one with inbuf or *inbuf equal to NULL, in order
       to flush out any partially converted input.

       Although inbuf and outbuf are typed as char **, this does not mean that the objects  they  point  can  be
       interpreted  as  C  strings or as arrays of characters: the interpretation of character byte sequences is
       handled internally by the conversion functions.  In some encodings, a zero byte may be a valid part of  a
       multibyte character.

       The  caller  of  iconv()  must ensure that the pointers passed to the function are suitable for accessing
       characters in the appropriate character set.  This includes ensuring correct alignment on platforms  that
       have tight restrictions on alignment.

VÉASE TAMBIÉN

       iconv_close(3), iconv_open(3), iconvconfig(8)

COLOFÓN

       Esta página es parte de la versión 5.10 del proyecto Linux man-pages. Puede encontrar una descripción del
       proyecto,   información   sobre   cómo   informar   errores  y  la  última  versión  de  esta  página  en
       https://www.kernel.org/doc/man-pages/.

TRADUCCIÓN

       La traducción al español de esta página del manual fue creada por Miguel Pérez Ibars <mpi79470@alu.um.es>

       Esta traducción es documentación libre;  lea  la  GNU General Public License Version 3  o  posterior  con
       respecto a las condiciones de copyright.  No existe NINGUNA RESPONSABILIDAD.

       Si  encuentra  algún  error  en  la  traducción  de esta página del manual, envíe un correo electrónico a
       debian-l10n-spanish@lists.debian.org.

GNU                                            15 Septiembre 2017                                       ICONV(3)