I’m currently using TinyMCE as html editor for users of my CMS.
Somehow the euro symbol (€) is converted to %u20AC by IE (any).
After a short search I found this. It gives a lot for different encodings for the UTF-8 euro symbol, but not %u20AC, with the percentage icon.
I have given the proper headers for UTF-8, so I gues IE is just being rude doing things its own way…
Is there a PHP function that can catch this strange encoding and put it to normal htmlentity (hex,decimal or named). I could just string_replace() this single problem symbol, but I’d rather fix all possible conflicts at once.
Or should I simply replace %u with &#x disabling normal usage of %u?
%u20ACis Unicode-encoded data for€which is generated by JavaScriptescape()function MDN, ECMA262 to UTF8 for server-side processing.Standard PHP
urldecode()can not deal with it (it is a non-standard percent encoding WP), so you need to use an extended routine:Also check if you can configure this behaviour for your TinyMCE.
References
preg_replace()– Regular expression search and replaceurldecode()– Decode URL-encoded stringhtml_entity_decode()– Convert HTML entities to their corresponding characters (here:&x20AC->€U+20AC EURO SIGN/\u{20AC}/\xE2\x82\xAC/\342\202\254)