� in my html after purify

走远了吗. 提交于 2019-12-06 03:57:04

Your character encodings are all out of whack. � is indicative to me of a three-byte UTF-8 encoded character.

Some things you need to discover

  • What is was the encoding of the old table?
  • What is the encoding of the new table?
  • What is the encoding of the page that displays ckeditor?

It looks like HTMLPurifier's default is UTF-8 so you really need to be aware of the encoding of your data!

Phill Pafford

Had a similar issue: php remove/identify this symbol �

The character � is the REPLACEMENT CHARACTER (U+FFFD). It is used when there was an error within an UTF code:

FFFD � REPLACEMENT CHARACTER

 - used to replace an incoming character whose value 
   is unknown or unrepresentable in Unicode

In most cases it means that some data is interpreted with an UTF encoding while the data is not encoded with that encoding but a different one.

My problem was pasting text from microsoft office products to html, or into a database. The largest offenders seem to be the emdash and smart quotes.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!