Tidy replacing   with a weird character

耗尽温柔 提交于 2019-12-05 18:01:56

问题


I am using Tidy (with PHP5) with UTF8 input, output, and char encoding enabled. When I clean a string with an   in it, it is replacing it with an odd character. I've tried messing with the tidy config but nothing I try seems to work.

Before Tidy:

This is a test.  Why does this not work?

After Tidy:

This is a test. ▒Why does this not work?

I don't know what the character is, but I assume it has something to do with the encoding of the enteties in utf8. Any ideas as to how I can get tidy to just leave the   alone?


回答1:


Have you tried the preserve-entities config option?



来源:https://stackoverflow.com/questions/6668131/tidy-replacing-nbsp-with-a-weird-character

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