Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 09-26-2011, 10:39 PM   #1
LQ Newbie
Registered: Sep 2011
Posts: 5

Rep: Reputation: Disabled
/usr/bin/iconv: illegal input sequence at position


We are migrating from UNIX to LINUX and we are using the iconv to convert some international characters
the unix version of the iconv command was
/usr/bin/iconv -f utf8 -t iso815
we converted it to
/usr/bin/iconv -f utf8 -t iso8895_15

We found in the iconv unix version that has the warnings:
If an input character does not have a valid equivalent in the code set
selected by the -t option (the "to" code set), it is mapped to the
"galley character", if it has been defined for that conversion. (see
genxlt(1) and iconv(3C) ).

The LINUX version did not have that mention but we found the following option to suppress warnings and still continue conversion

/usr/bin/iconv -sc -f utf8 -t iso8895_15

Is that sufficient or we need to use another codepage in our -t option?

One of the words that it is having hard to convert is BUDA¾RS

I looked at the UNIX version and it ignored it and converted it to
BUDARS ignoring the ¾

The file is coming from our source from Hungary and other Western Europe codes
Old 09-27-2011, 04:40 PM   #2
David the H.
Bash Guru
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian + kde 4 / 5
Posts: 6,842

Rep: Reputation: 2004Reputation: 2004Reputation: 2004Reputation: 2004Reputation: 2004Reputation: 2004Reputation: 2004Reputation: 2004Reputation: 2004Reputation: 2004Reputation: 2004
The gnu version of iconv offers a couple of internal filters for dealing with unsupported characters. They can be called in the shell program by tacking a string onto the "to" code. They may be undocumented in the man pages of some distros (or even unavailable?).

/usr/bin/iconv -f utf8 -t iso8895_15//IGNORE

/usr/bin/iconv -f utf8 -t iso8895_15//TRANSLIT
The first is equivalent to the -c option. It will simply remove the unsupported character from the text. The second is smarter, and will attempt to substitute it with a similar character from the target set.
1 members found this post helpful.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Iconv error : illegal input sequence at position ninjakdb Linux - Newbie 8 11-19-2013 03:11 PM
/usr/bin/ld: warning: i386 architecture of input file nasridine Linux - Software 2 07-23-2010 12:14 PM
echo $PATH = /home/g3rc4n/bin:/usr/local/bin:/usr/bin:/bin:/usr/games ? i_heart_pandas Linux - Software 7 09-18-2009 09:33 AM
Failed to chck remot comnd executin using shells /usr/bin/ssh and /usr/bin/rsh farnaw4u Linux - Software 2 04-06-2009 01:08 AM
man gives error information(iconv: illegal input sequence at position XX) haodongdong Linux - Software 1 05-04-2005 11:38 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:35 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration