Using UTF-8 charset with PHP - are mb functions required?

后端 未结 8 2092
不知归路
不知归路 2021-01-01 02:05

These past few days I\'ve been working toward converting my PHP code base from latin1 to UTF-8. I\'ve read the two main solutions are to either replace the single byte funct

8条回答
  •  鱼传尺愫
    2021-01-01 02:05

    They aren't "necessary" unless you're using any of the functions they replace (and it's likely that you are using at least one of these) or otherwise explicitly need a feature of the extension such as HTTP handling.

    When working towards UTF-8 compliance, I always fall back to the PHP UTF-8 Cheatsheet with one addition: PCRE patterns need to be updated to use the u modifier.

提交回复
热议问题