开发者

Accents in URL, how can I escape them correctly ?

开发者 https://www.devze.com 2023-03-14 08:37 出处:网络
I have to get what is next to the # character in the URL (in javascript). When there\'s an é, for example, 开发者_开发技巧I get escaped characters. I can unescape() them, but I get weird characters s

I have to get what is next to the # character in the URL (in javascript). When there's an é, for example, 开发者_开发技巧I get escaped characters. I can unescape() them, but I get weird characters such as Ã. How can I get the right characters ?


use encodeURIComponent and decodeURIComponent. escape and unescape will be useful only for ASCII charset, while the former supports unicode charsets.

0

精彩评论

暂无评论...
验证码 换一张
取 消