fwrite() and UTF8

后端 未结 8 978
隐瞒了意图╮
隐瞒了意图╮ 2020-12-05 16:02

I am creating a file using php fwrite() and I know all my data is in UTF8 ( I have done extensive testing on this - when saving data to db and outputting on normal webpage a

8条回答
  •  南笙
    南笙 (楼主)
    2020-12-05 16:31

    The problem is your data is double encoded. I assume your original text is something like:

    Don’t do anything

    with , i.e., not the straight apostrophe, but the right single quotation mark.

    If you write a PHP script with this content and encoded in UTF-8:

    You will get something similar to your output.

提交回复
热议问题