htmlentities destroys utf-8 strings

前端 未结 5 558
旧巷少年郎
旧巷少年郎 2020-12-15 17:21

I got something weird happening here and I can\'t understand why, on my php 5.2.5 server (Just on Linux ,Windows php servers doesn\'t have same problem) When I use a POST F

5条回答
  •  北海茫月
    2020-12-15 17:38

    The only way to change htmlentities()'s encoding is specifying it in its third parameter.

    There is no way to change the default encoding. Prior to PHP 5.4 It is always iso-8859-1.

    This was changed in PHP 5.4 however and is now always utf-8

提交回复
热议问题