The default encoding of php program written on windows platform is gb2312 and the default encoding of linux and apche are UTF-8, so the php program written on windows platform is uploaded to linux, browsing the Chinese web page is garbled. If the manual php encoding with notepad ++ code to UTF-8 can display normal but if the program is more, each change, the workload is also compared
The default encoding of php program written on windows platform is gb2312 and the default encoding of linux and apche are UTF-8, so the php program written on windows platform is uploaded to linux, browsing the Chinese web page is garbled. If the manual php encoding with notepad ++ code to UTF-8 can display normal but if the program is more, each change, the workload is also compared
The default encoding of php programs written on windows is gb2312.
The default encoding for linux and apche is UTF-8
Therefore, after a php program written on windows is uploaded to linux, Chinese characters on the webpage are garbled.
If the manual php encoding with notepad ++ code to UTF-8 can display normal
However, if there are too many programs, each of them will be changed, and the workload will be relatively large.
Another way is to modify the default Apache encoding.
Location:
Vim/etc/httpd/conf/httpd. conf
Comment out the original UTF-8 and change it to gb2312
# Adddefacharset UTF-8
Adddefacharcharset gb2312
Restart the apache service.