Home  >  Article  >  Operation and Maintenance  >  How to solve the inconsistency between Linux and Windows coding

How to solve the inconsistency between Linux and Windows coding

小云云
小云云Original
2018-03-03 10:36:092678browse

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

Find the corresponding active code page


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

Check the encoding format being used by linux


locale

Check which encoding formats are supported by linux


locale -a

Modify linux encoding format (centos7)


vim /etc/locale.conf

Modify to


LANG=zh_CN.gb2312

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

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!

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