Home >php教程 >PHP开发 >Solution to Linux displaying Chinese garbled characters

Solution to Linux displaying Chinese garbled characters

高洛峰
高洛峰Original
2016-12-15 16:26:521588browse

I often use the Linux terminal, and when someone uploads a file with a Chinese name, it shows Chinese garbled characters. Here is the solution.

Character encoding displayed by default

# echo $LANG
en_US.UTF-8

Modify i18n file

# vi /etc/sysconfig/i18n

LANG="zh_CN.GB18030"
LANGUAGE="zh_CN.GB18030:zh_CN.GB2312:zh_CN"
SUPPORTED="zh_CN.GB18030:zh_CN:zh:en_US.UTF-8:en_US:en"
SYSFONT="lat0-sun16"

Re-log in to the terminal before displaying character encoding

# echo $ LANG

zh_CN.GB18030



For more articles related to solutions to Chinese garbled characters displayed in Linux, please pay attention to 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