PHP messing with HTML Charset Encoding

前端 未结 4 914
余生分开走
余生分开走 2020-11-27 08:15

I have this very strange problem. I have a site that contains some German letters and when it\'s only html without php the symbols are property displayed with encoding when

4条回答
  •  無奈伤痛
    2020-11-27 08:38

    Can you check what is the value of HTTP header Charset in Response Headers. Though the information is old(2009), i don't know if it still holds: the default charset in PHP is UTF-8 if you don't provide the content-type header with charset. Source

    Hence set the header explicitly:

    header("Content-type:text/html; charset: iso-8859-1");
    

提交回复
热议问题