I am using HTML Purifier in my PHP project and am having trouble getting it to work properly with user input.
I am having users enter in HTML using a WYSIWYG editor (TinyMCE), but whenever a user enters in the HTML entity
(non-breaking space) it gets saved into the database as this weird foreign character (Â
).
However, the thing is, when I edit the saved entry using the WYSIWYG editor it gets displayed properly as
. It also functions properly when displayed, only that in the source code it appears as a real space, but not the non-breaking space character.
Also, in the MySQL database it displays as the weird foreign character.
I read the doc about Unicode and HTML Purifier and changed my database and web page encoding to be UTF-8, but I am still having problems with the non-breaking space character not being mangled. The other HTML entities, such as <
and >
, get saved as <
and >
, but why not
?