In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This "Linux system how to view file coding" article, the article example code introduction is very detailed, with a certain reference value, interested friends must refer to, for the "Linux system how to view file coding", Xiaobian sorted out the following knowledge points, please follow the pace of the editor step by step slowly understand, then let us enter the topic.
1. Description of the problem (coding problems often encountered under linux) A program written by my brother under windows (written by Cpicard +) was passed to me to run under Linux, compiled and output garbled in Chinese.
two。 Reason analysis if you need to manipulate files under windows in Linux, you may often encounter the problem of file encoding conversion.
The default file format in Windows` is `cp936` (usually regarded as equivalent to `GBK`), while `Linux` is generally `UTF-83. Background knowledge (what is coding?) For the definition of coding, we can look at Baidu Compendium.
4 the method of viewing the code under linux 1: file filename
File cp936.c1
Method 2: you can view the file encoding directly in Vim
: set fileencoding1 can display the file encoding format
If you just want to view files in other encoding formats or want to solve the problem of garbled viewing files with Vim, you can use the
Add the following to the ~ / .vimrc file
Set encoding=utf-8 fileencodings=ucs-bom,utf-8,cp93612
In this way, you can let vim automatically identify file encodings (you can automatically identify UTF-8 or GBK encoded files), which is actually an attempt according to the coding list provided by fileencodings. If you do not find a suitable encoding, open it with latin-1 (ASCII) coding.
What are the versions of Linux? the versions of Linux are Deepin, UbuntuKylin, Manjaro, LinuxMint, Ubuntu and so on. Among them, Deepin is one of the best-developed Linux distributions in China; UbuntuKylin is a derivative release based on Ubuntu; Manjaro is a Linux release based on Arch; LinuxMint's default Cinnamon desktop is similar to Windows XP's easy-to-use; Ubuntu is the Linux operating system based on desktop applications.
The above is all the contents of the article "how to View File Encoding in Linux system". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
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.