Home>Article>Operation and Maintenance> How to solve the centos6 terminal garbled problem

How to solve the centos6 terminal garbled problem

藏色散人
藏色散人 Original
2022-01-07 16:19:45 2776browse

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
LANG

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

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

It takes effect permanently:

Edit /etc/locale.conf

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

-- ------------------------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

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!

Statement:
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