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

What if there is garbled code when opening Emacs under Linux

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

Share

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

This article mainly introduces what to do when opening Emacs under Linux. It is very detailed and has a certain reference value. Friends who are interested must finish reading it.

Emacs is recognized as one of the best code editors, and many users use Emacs on Linux systems. However, because the default encoding is different from the document encoding, it will often lead to garbled code in Emacs. The following editor will introduce the solution to garbled code when opening Emacs under Linux. Let's go and have a look!

For beginners, we should solve it in the following two ways:

Method 1:

All you need is Cmurx r (Mmerx revert-buffer-with-coding-system) to re-read the file with the specified encoding. Generally, garbled code is due to the use of latin or utf8 under emacs, while the open document is gb2312 encoded. If you don't remember the coding type, give it a try. Basically, gb2312 can solve it. It is convenient to remember to use tab to make up when asking for coding. Or you can view it through the file file name or the enca file name!

As shown in the figure:

I chose gb18030-unix here.

The effect of transcoding is as shown in the figure:

Method 2:

Use the unicad plug-in to download unicad.el and save it to the appropriate directory (for example, configure the my-elisp folder as the storage directory in .emacs), and then declare (require 'unicad) in .emacs. In this way, the encoding type will be judged automatically the next time the document is opened, which is very convenient.

The above is all the contents of this article "what to do when opening Emacs under Linux?" Thank you for your reading! Hope to share the content to help you, more related 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.

Share To

Servers

Wechat

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

12
Report