I have a javascript function that takes as argument a string that is UrlEncoded.
I'm using tags with href="javascript:..." (I know it's wrong to use this, but it's legacy code that i have to maintain... and changing this to onclick would break our API.)
Chrome and Firefox interpret the '%C3%A9' to 'é' correctly but ie interprets it as 'é'. If it was in onclick, i could explicitely unescape the string, but with the href="javascript.." IE interprets its before i can unescape it correctly.
<a href="javascript: alert('%C3%A9')">href</a>
<a href="#" onclick="alert('%C3%A9')">onclick</a>
See the fiddle : http://jsfiddle.net/nCvsg/2/ (in IE).
Document is set to UTF8. Is there a way to solve this in IE?
location = "javascript: alert('%C3%A9')";
. It seems like IE does not support UTF-8 there. – Fabrício Matté Jul 22 '13 at 20:48alert('\u00E9')
, and evenalert('é')
. Don't know what your constraints are. – Natasha Banegas Jul 22 '13 at 22:21