Hi,
On the preview JavaScript why don't we use encodeURIComponent instead of replace(/&#/g, \'&#\').php_to8bit().php_urlencode().
I am not saying this as a feature request, because the current setup has the script encoding wrong and sometimes halting on special Unicode characters.
I know it probably isn't going to be as easy as use a default JavaScript function compared to home brewed compatibility. I say this because there has to be a reason the team took a different route here, but I am not seeing it. From the looks here it looks like encodeURIComponent is the better option as it doesn't bug out from what I seen on these characters.
Unless there is a reason for it being done this way when I get back home to my workstation in another 1.5 weeks, I will submit a commit to fix this in the 2.1 branch.
Any comments/concerns?
It's that way for legacy reasons, for matching PHP's behaviours in terms of ISO encoding. If UTF-8 I believe it can be safely changed.
I didn't consider ISO, that explains it.
So changing this should be safe in 2.1 but in 2.0 depending on the site setup may be problematic.
Thanks for the information, I been pondering about this.
Sounds like a plan to me.
That's the terrible thing about ISO, is that it mangles a lot of stuff :(