Unable to convert correct characters from gb2312 to utf8

Solution Unverified - Updated -

Issue

  • In the System , it is not able to covert the correct characters. For example, the original file charatercs is gb2312 or gb18030 gbk, run the below command:
iconv -t utf-8  example.txt -o  utf.txt 

There some error is as the below:

iconv : unkown 170  invalid  input 

The system Language environment is :

echo $LANG
LANG=zh_CN.gb2312

How to fix it ?

Environment

  • Red Hat Enterprise Linux 5

  • Red Hat Enterprise Linux 6

  • Red Hat Enterprise Linux 7

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