url encoding - How to decode url-encoded string in javascript -
i use javascript / jquery fill dom elements contain umlauts:
var text1 = "unser platonisches internetreich droht in die h%e4nde einer bewaffneten miliz zu fallen." $("#quote1 span").html(unescape(text1)); how can rid of url encoding e.g. "h%e4nde" , use "hände" instead? tried
<meta charset="utf-8" /> <meta name="http-equiv" content="content-type: text/html; charset=utf-8"/> <script type="text/javascript" src="js/index.js" charset="utf-8"></script> but none of them seem work...
thanks help.
that not utf-8, percent encoding known url encoding.
you can use decodeuricomponent() convert before displaying it
$("#quote1 span").html(decodeuricomponent(text1));
Comments
Post a Comment