Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

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

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

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,./

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report