In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail about linux system terminal cat Chinese garbled/vim not garbled or cat not garbled/vim Chinese garbled example analysis, the quality of the article content is high, so Xiaobian share for everyone to make a reference, I hope you have a certain understanding of related knowledge after reading this article.
Scenario: in linux system terminal, use cat to view Chinese document garbled, and use vim to view the same file without garbled. (secureCRT window code utf-8)
Use cat to view Chinese documents without garbled, the same file using vim to view garbled. (secureCRT window code is gb2312)
Analysis: The two cases are garbled separately, so it is determined that cat and vim use different decoding methods, resulting in this situation.
Workaround: change vim parse file encoding.
In vimrc, you can set encoding, fileencoding and fileencodings.
encoding: vim internal encoding method, consistent with locale by default
fileencoding: encoding method used when creating new text
fileencodings: the encoding method used when opening text, there can be multiple, decoding one by one
Changed settings:
set fileencodings=utf-8,gbk,gb2312,gb18030
set fileencoding=utf-8
set encoding=gbk
gb18030 for secureCRT windows
linux system code/etc/sysconfig/i18n LANG="zh_CN.GB18030"
If an error occurs while executing the print script, add it in the first line
#coding:utf-8
On linux system terminal cat Chinese garbled/vim not garbled or cat not garbled/vim Chinese garbled sample analysis shared here, I hope the above content can be of some help to everyone, you can learn more knowledge. If you think the article is good, you can share it so that more people can see it.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.