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

The solution to the problem of Chinese garbled Code on the Command Line under ubuntu

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article mainly introduces "the solution to the problem of Chinese garbled code on the command line under ubuntu". In the daily operation, I believe that many people have doubts about the solution to the problem of Chinese garbled code on the command line under ubuntu. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful for you to answer the doubt of "the solution to the problem of Chinese garbled code on the command line under ubuntu". Next, please follow the editor to study!

The reason is that Chinese was selected during the installation, so the default configuration of the system is also set to Chinese and changed to English.

Solution 1: learn English well. Set the environment variable to English. Don't slap me.

Modify / etc/default/locale

Sudo vim / etc/default/locale1

Modify the default

LANG=zh_CN.UTF-8

LANGUAGE=zh_CN:zh

Are:

LANG= "en_US.UTF-8"

LANGUAGE= "en_US:en"

Save and exit

Then:

Sudo reboot

And then...

Env or locale can view the modified results.

Solution 2: that's what I'm talking about. Just install a zhcon.

Enter at the terminal or on the command line

Sudo apt-get install zhcon

Wait until the installation is finished.

Remember to load the vgz driver and utf8 support when running, otherwise the screen will be blacked out.

And it can only be run on the pure command line and running on the terminal will make an error.

So your order should be zhcon-- utf8-- drv=vga

If you find it too troublesome to type so much every time, you can add an alias to ~ / .bashrc.

Sudo vim / .bashrc

After opening it, add a line to it.

Alias zhcon='zhcon-utf8-drv=vga'

Save exit

In this way, you don't have to worry about the black screen by running zhcon directly after entering the command line.

Zhcon supports Chinese display and Chinese input method due to hotkey conflict, I only know that Ctrl+ space switch to full spelling input method is

Can be used to more or less solve the problem of Chinese directory / file name

At this point, the study of "the solution to the Chinese garbled code problem on the command line under ubuntu" is over. I hope to be able to solve everyone's doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

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