html php meta charset UTF-8 not working? [duplicate]

℡╲_俬逩灬. 提交于 2019-12-12 10:10:12

问题


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.


回答1:


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');



回答2:


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.



来源:https://stackoverflow.com/questions/12276817/html-php-meta-charset-utf-8-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!