The website test text is garbled. my database character is GB2312_CHINESE_BINfun.php. The character set is gb2312, except for the PHP code-only page, after each page is changed, the text display of the gb2312 webpage code is correct. However, in pure PHP code, the text in the output table is garbled. how can this problem be solved? ------ Solution -------------------- set the header on the php page (& q website test text display garbled problem
The character of my database is GB2312_CHINESE_BIN.
The character set for fun. php is gb2312.
Except for pages with pure PHP code, each page is changed to gb2312
The text display of the webpage code is correct,
But in pure PHP code, the text in the output table will show garbled characters. how can this problem be solved?
------ Solution --------------------
Set header ("Content-type: text/html; charset = gbk") on the php page. select gbk for encoding when saving the php file.
------ Solution --------------------
Yes, the program file must also be saved as gbk... The problem I encountered was to unify everything into utf8, but many times the code file is not stored in utf8, and garbled characters may occur.
------ Solution --------------------
Well. When retrieving data. Add mysql_query ("set names 'gbk '");
------ Solution --------------------
Discussion
Reference:
Set header ("Content-type: text/html; charset = gbk") on the php page. select gbk for encoding when saving the php file.
Header ("Content-type: text/html; charset = gbk ");
...?>
Is it like this ??
------ Solution --------------------
PHP code
------ Solution --------------------
Discussion
But in pure PHP code, the text in the output table will show garbled characters. how can this problem be solved?
------ Solution --------------------
Discussion
Set header ("Content-type: text/html; charset = gbk") on the php page. select gbk for encoding when saving the php file.