开发者

php setting encoding iso-8859-1 by default in browser

开发者 https://www.devze.com 2023-01-05 11:12 出处:网络
I have a php file which when displays data shows s开发者_开发问答trange characters, but when I change encoding from tools in chrome to iso-8859-1 the strange characters are displayed correctly, the st

I have a php file which when displays data shows s开发者_开发问答trange characters, but when I change encoding from tools in chrome to iso-8859-1 the strange characters are displayed correctly, the strange characters are actually Portuguese alphabets. please tell how can we set by default the encoding to iso-8859-1.


header('Content-Type: text/html; charset=iso-8859-1');

You should ideally use utf-8. If it doesn't work automatically, that means it's improperly encoded on the database and you should convert it to utf-8.

0

精彩评论

暂无评论...
验证码 换一张
取 消