PHP messing with HTML Charset Encoding

前端 未结 4 915
余生分开走
余生分开走 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:29

    Updated I need to get my encode/decode de-confused.

    When you're in PHP try decoding the string in UTF-8 before output.

    $str = 'I ãm UTF-8';
    echo(utf8_decode($str));
    

    This worked for me:

    
    Test: 
    

    Value in Input (via Cut n Paste):

    I ãm UTF-8: ÖMG!

提交回复
热议问题