How to solve the inconsistency between Linux and Windows coding

小云云
Release: 2018-03-03 10:36:09
Original
2733 people have browsed it

Windows encoding cannot be modified. Modify the linux encoding to make it consistent with the windows encoding. This article mainly summarizes the solutions to the inconsistency between Linux and Windows coding and related points of attention. I hope it can help you.

Check the windows encoding format, open cmd


chcp
Copy after login

Find the corresponding active code page


52936  简体中文(HZ)
936   中国 - 简体中文(GB2312)
950   繁体中文(Big5)
65001  Unicode (UTF-8)
1200   Unicode
Copy after login

Check the encoding format being used by linux


locale
Copy after login

Check which encoding formats are supported by linux


locale -a
Copy after login

Modify linux encoding format (centos7)


vim /etc/locale.conf
Copy after login

Modify to


LANG=zh_CN.gb2312
Copy after login

Note: The blogger’s active code page is 936, which corresponds to the zh_CN.gb2312 code viewed by locale -a

Restart to take effect


reboot
Copy after login

Related recommendations:

Share examples of obtaining current stack information on Linux and Windows

About linux and windowsXP How to deal with the difference in apache address rewriting

Solution to MySQL Chinese garbled code when using QT under Linux and Windows

The above is the detailed content of How to solve the inconsistency between Linux and Windows coding. 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