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

Centos modifies character encoding to make centos support Chinese

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

Share

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

This article mainly explains "centos modifies character coding to make centos support Chinese". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "centos modifies character coding to make centos support Chinese".

1. Chinese support

Install the Chinese language pack:

The code is as follows:

Yum groupinstall chinese-support

Modify the character encoding configuration and create it without this file:

The code is as follows:

Vim / etc/sysconfig/i18n

The modified content is as follows:

The code is as follows:

LANG= "zh_CN.GB18030"

SUPPORTED= "zh_CN.UTF-8:zh_CN:zh:en_US.UTF-8:en_US:en"

SYSFONT= "latarcyrheb-sun16"

I18n files are used to set system languages, such as zh_CN.UTF-8, zh_CN.GB18030, zh_TW.Big5, en_US.UTF-8, etc.

Three environment variables in i18n:

LANG variable to set the system language.

The SUPPORTED variable determines the language that the system supports, that is, the language that the system can display.

The SYSFONT variable represents the system font.

Finally, restart the server:

The code is as follows:

Reboot

In this way, Chinese will appear in the command interaction of the character interface, but some of the translation is incomplete.

Use the locale command to view the system language settings:

The code is as follows:

Locale

LANG=zh_CN.GB18030

LC_CTYPE= "zh_CN.GB18030"

LC_NUMERIC= "zh_CN.GB18030"

LC_TIME= "zh_CN.GB18030"

LC_COLLATE= "zh_CN.GB18030"

LC_MONETARY= "zh_CN.GB18030"

LC_MESSAGES= "zh_CN.GB18030"

LC_PAPER= "zh_CN.GB18030"

LC_NAME= "zh_CN.GB18030"

LC_ADDRESS= "zh_CN.GB18030"

LC_TELEPHONE= "zh_CN.GB18030"

LC_MEASUREMENT= "zh_CN.GB18030"

LC_IDENTIFICATION= "zh_CN.GB18030"

LC_ALL=

The default language is en_US.UTF-8 or POSIX, and when set to zh_CN.GB18030.

2. Vim displays Chinese

After installing the Chinese package, edit the configuration file vimrc of vim:

Vim / etc/vimrc

Add the following at the end:

The code is as follows:

Set fileencoding=utf-8

Set fileencodings=utf-8,gb18030,gbk,big5

At this point, I believe you have a deeper understanding of "centos modifies character coding to make centos support Chinese". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

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