Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Accents in URL, how can I escape them correctly ?

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 ?

like image 924
Sam Avatar asked Dec 22 '22 12:12

Sam


1 Answers

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

like image 64
Rodrigo Avatar answered Dec 24 '22 02:12

Rodrigo