__etoa() — EBCDIC to ISO8859-1 string conversion

Standards

Standards / Extensions C or C++ Dependencies
z/OS® UNIX both  

Format

#include <unistd.h>

int __etoa(char *string);

General description

The __etoa() function converts an EBCDIC character string string to its ISO8859-1 equivalent. The conversion is performed using the codeset page associated with the current locale. The input character string up to, but not including, the NULL character is changed from the current locale to an ISO8859-1 representation.

The argument string points to the EBCDIC character string to be converted to its ISO8859-1 equivalent.

Returned value

If successful, __etoa() converts the input EBCDIC string to its equivalent ISO8859-1 value, and returns the length of the converted string.

If unsuccessful, __etoa() returns -1 and sets errno to one of the following values. (This function internally may call iconv_open() and iconv(). The errnos returned by these functions are propagated without modification.)
Error Code
Description
EINVAL
The current locale does not describe a single-byte character set.
ENOMEM
There is insufficient storage to complete the conversion process.

Related information