Something I came across today when dealing with Chinese languages –
the javascript escape() function only works for ASCII characters, so if you are using another language things tend to go wonky pretty quick.
The function you want to use is encodeURIComponent() which will handle Unicode quite happily.
For a bit more reading: WorldTimZone's article on UTF-8 encoding for older browsers.
Comments
The function <a href="http://www.kanolife.com/escape/2006/03/escape-and-unescape-javascript.html">utf8Escape</a> generates a pure UTF8 escaped string and will should handle all Unicode character sets on Unicode enabled browsers. It is also fully compatible with the JavaScript "unescape" function.
This shoud link to code.
How do I compare the image that was created to the text field. Do I pass something in a hidden field? Is there an example of how this Add Comment code does the comparison? Thanks!
Tools on this website: http://www.webtoolkit.info/ can do the job very well.
Thanks! Saved some time.
Thanks a lot man! Just solved our problem and our headache… 😉 Not that easy to hunt down these kind of bugs when you’re working with Ajax/JEE.
Thanks man, very usefull. The encodeURIComponent() function works perfect instead of escape()
Bye
JD
thanks dude, works pretty good at pdfcast.org
does it work well on cross-browsers?
Perfect! It solves all issues using EncodeURIComponent instead of Escape and EncodeURI.
Thanks a lot
Thanks!!
I was just browsing for related blog posts for my project research and I happened to discover yours. Thanks for the excellent information!