Search code examples
tinymcespecial-characters

How can I stop TinyMCE from converting HTML entities back to special characters?


When I put something like £ or © into my TinyMCE editor and save the text, then when I load the text back from the database, it appears to turn into the actual £ and © characters. I don't want that. When I check my database, I see that these symbols are stored as £ and ©, so it's not a storage problem. Also if I try to store the symbols as £ and ©, that doesn't work either, as the character sequences are still converted into original symbols.

What can I do to fix this?

Thanks.


Solution

  • It turns out that I can just htmlspecialchars() the text in my PHP script, and it correctly handles both the formatting and the sequences that are entered. This is rather unexpected, but it actually works out to do the right thing.