html php meta charset UTF-8 not working? [duplicat

2019-05-27 09:04发布

Possible Duplicate:
Browser displays � instead of ´

i'm kind of stuck on a php file with almost only html in it. I use PHP only to send information from a contact form to my mail adres.

When developing the website on localhost everything was all fine. After uploading to my server it messes up the special characters.

My meta tag looks like this:

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

If someone could please help me it would be highly appreciated.

2条回答
Summer. ? 凉城
2楼-- · 2019-05-27 09:57

If your browser is specifically styled to have the character set as ISO-8859-1 or another charset, it will still display in that charset. I think that's the only problem I can detect.

查看更多
男人必须洒脱
3楼-- · 2019-05-27 10:04

Add this to the header in your php file and let me know if it solves or not -

header('Content-Type: text/html; charset=UTF-8');
查看更多
登录 后发表回答