Site icon David Yin's Blog

How to enable GBK encoding

The situation is WebPage was made by GBK encoding. GBK is one of the Chinese Encoding.
When the browser loading the page, it always return UTF-8.
It should be GBK.
I checked the head of the webpage.

content=”text/html; charset=gb2312″

Different browsers tested. All failed.
How to fix this problem and let the server feedback the GBK/GB2312 code?


It is Apache server setting.
Directives of this site.
Add these two
AddDefaultCharset GBK
LanguagePriority

And also edit httpd.conf
# AddDefaultCharset UTF-8
AddDefaultCharset off

Restart Apache. Done.
If you use other coding, you can still use this method to fix the problem.

Exit mobile version