Why iconv throws "illegal input sequence" error?

Solution Verified - Updated -

Issue

  • iconv command reports "illegal input sequence" and fails to change the encoding.
$ iconv -f IBM1388 -t GB18030 test > output_bad_GB18030
iconv: illegal input sequence at position 171

Environment

  • Red Hat Enterprise Linux 6
  • Red Hat Enterprise Linux 7
  • glibc-common

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content