I have imported with Perl a table from our database AS/400 DB2.
The problem is that the string are encoded in EBCDIC Latin-1 (italian language).
How can I convert the resulting file to plain utf-8 in Linux bash?
Start with
iconv -f EBCDIC-IT -t utf-8 <filename>
then check the output, and if it isn't exactly correct, check man iconv
and the available encodings listed by iconv -l
.
(Note that "EBCDIC Latin-1" is somewhat strange. "Latin-1" indicates ISO-8859-1, while "EBCDIC" is something else entirely. Try file <filename>
to get an educated guess by the computer as to what encoding you are actually looking at.)