@name@(3)

@name@ - Convert encoding

SYNOPSIS
#include <libuciconv-0/iconv.h>

size_t @name@(const char *tocode, const char *fromcode,
                   char *inarray, size_t *inlen,
                   char *outarray, size_t *outlen,
                   int flag);

Supported values for flag (by version @version@ of @package@):

UCIC0_ICONV_REPLACE_INVALID
    Do not stop on illegal characters from inarray and instead treat such characters as non-identical conversion cases.

UCIC0_ICONV_IGNORE_NULL
    A NUL control character does not stop the conversion and the conversion continues until inlen pointed amount of inarray bytes are all consumed for conversion or an error occurred.

PARAMETERS

tocode
    Target codeset name (NUL-terminated string)

fromcode
    Source codeset name (NUL-terminated string)

inarray
    Pointer to a byte array

inlen
    Number of input bytes (left)

outarray
    Pointer to a byte array

outlen
    Number of output bytes (converted)

flag
    Conversion options

DESCRIPTION

inarray must contain a sequence of character bytes with fromcode encoding to be converted.

inlen , as input argument, contains the number of bytes to be converted in inarray.

inlen , as output argument after the conversion, contains the number of bytes in inarray still not converted after the conversion.

outarray must provide enough space for the output data (stored with tocode encoding).

outlen , as intput argument, contains the number of bytes at outarray where converted character bytes can be saved.

outlen , as output argument after the conversion, contains the number of bytes still available at outarray .

The parameter flag must be constructed by a bitwise-inclusive-OR of the values documented above.

RETURN VALUE

(size_t)-1 on error.

If the return value indicates an error, errno is set to a nonzero value.
One of the following error codes is used for POSIX systems:

E2BIG
    Not enough space in the output array

EBADF
    Requested conversion not supported

EILSEQ
    An input octet does not belong to the input codeset

EINVAL
    Input conversion stopped due to an incomplete character or shift sequence at the end of the input array

On bare C90 systems, errno is set to -1 instead.

STANDARDS

The parameters, values and behaviour are intended to be compatible with the iconvstr() function of Solaris 11.

SEE ALSO
ucic0_iconv(1), ucic0_print_codesets(3)