How to solve the centos6 terminal garbled problem

藏色散人
Release: 2022-01-07 16:19:45
Original
2825 people have browsed it

Solution to centos6 terminal garbled characters: 1. Set "export LC_ALL=zh_CN.UTF-8"; 2. Edit "/etc/locale.conf" and set "LANG=zh_CN.UTF-8 LC_ALL= zh_CN.UTF-8" is enough.

How to solve the centos6 terminal garbled problem

#The operating environment of this article: centos6 system, Dell G3 computer.

How to solve the centos6 terminal garbled problem?

Centos6.x terminal Chinese garbled solution:

locale
Copy after login
LANG
Copy after login

The default value of LC_* is the lowest level setting. If LC_* is not set, then use this value. Similar to LC_ALL.

 LC_ALL
Copy after login

It is a macro. If the value is set, the value will overwrite all LC_* setting values. Note that the value of LANG is not affected by this macro.

It takes effect directly without restarting:

export LC_ALL=zh_CN.UTF-8
Copy after login

It takes effect permanently:

Edit /etc/locale.conf

LANG=zh_CN.UTF-8
LC_ALL=zh_CN.UTF-8
Copy after login
#用这个就行了,但是不知道为什么
echo.UTF-8 > /etc/sysconfig/i18n
Copy after login

-- ------------------------The original text below does not seem to work and will cause English display errors--------

Modify/ etc/profile file

vim /etc/profile
#添加这行
export LC_ALL="zh_CN.GB18030"
 
#立即生效
source /etc/profile
Copy after login

Recommended tutorial: "centos tutorial"

The above is the detailed content of How to solve the centos6 terminal garbled problem. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!