Get the App
SLTechnology News&Howtos  ›  Servers  › 

Displaying incomplete or garbled codes, dos2unix and modifying the system character set do not work

Shulou Source: shulou.com Published: 2022-06-02 13:42:47 10月01日 Update

Scenario: text files under Windows are not displayed or garbled when uploaded to Linux to execute cat, whether it is to modify the character set of the ssh client software, modify the system character set or use dos2unix conversion, what if it doesn't work?

Yum install dos2unix-y

Problem ①: after uploading rz, a normal character is less than cat, and after dos2unix, it is still less than cat

Question ②: cat shows incomplete and garbled code after rz upload, while cat still shows incomplete and garbled code after dos2unix.

Solution:

# iconv-f gb2312 old.txt-o new.txt

[root@VM_201_139_centos] # iconv-f gb2312 Tencent Cloud is catching up with Aliyun. Txt-o new.txt

[root@VM_201_139_centos ~] # cat new.txt

Tencent Cloud is catching up with Aliyun.

Tencent Cloud is catching up with Aliyun.

Tencent Cloud is catching up with Aliyun.

Tencent Cloud is catching up with Aliyun.

Tencent Cloud is catching up with Aliyun.

[root@VM_201_139_centos] # iconv-f gb2312 one two three four five six seven. Txt-o newnew.txt

[root@VM_201_139_centos ~] # cat newnew.txt

Asdfghjkl;' one, two, three, four, five, six, seven.

Enchantment and charm 1234567890 color = lute and lute

Qwertyuiop []\ League of Legends

Zxcvbnm,./

Tags: Ali Tencent or garbled character character set problem system enchantment scene client client what to do file text scheme lute pipa alliance Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Redmi Huawei Microsoft Xiaomi