UTF-8 to EBCDIC conversion in UNIX

Hi all,

At present a file from AS400 system is being FTPed to an AIX system.
Now, a similar file needs to be sent from our Unix box (Solaris)

Is there any tool available which does the conversion in Unix from UTF-8 to EBCDIC?

Any suggestions/ pointers are really appreciated.

Thanks,
Sridhar

Do you have iconv installed?

Under Linux, my man pages suggest that your task can be achieved with :

iconv --from-code=UTF-8 --to-code=EBCDIC --output=FILE SourceFile

. If you have iconv, just check the man pages.

Hi,

iconv is there on our server. But it always gives the same message "From" charset to "To" charset conversion is not supported.
iconv -f 1256 -t 420 file > outFile

Did I miss anything here?

Thanks,
Sridhar

I suspect your syntax is wrong. First list the supported charsets using iconv --list to check if the required charset is supported on your system.

Assuming you want to convert from UTF8 to US EBCDIC, on a Fedora 10 system the syntax is

iconv -f UTF8 -t EBCDIC-US file > outfile