Home> php教程> PHP开发> body text

Solution to Linux displaying Chinese garbled characters

高洛峰
Release: 2016-12-15 16:26:52
Original
1495 people have browsed it

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"
Copy after login

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!

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