Reputation: 1147
I have this line to get the query string from this url http://localhost:4200/אבי
:
const path = location.path(true); // returns "%D7%90%D7%91%D7%99"
Can I convert it back to normal hebrew letters (in this case אבי
)?
Upvotes: 2
Views: 240
Reputation: 10342
You can use the global function decodeURI
:
console.log(decodeURI("%D7%90%D7%91%D7%99"));
There is a counterpart, encodeURI
to make the opposite:
console.log(encodeURI("אבי"));
Upvotes: 4