I am having hundeausführer (in German) text in URL and it is giving me as hundeausf%C3%BChrer in console.log. How can I convert hundeausf%C3%BChrer back to hundeausführer?
I tried
console.log(unescape(encodeURIComponent('hundeausf%C3%BChrer')));
console.log(decodeURIComponent(escape('hundeausf%C3%BChrer')));
but not getting a proper answer in the console log.
Getting the same text as hundeausf%C3%BChrer
Anyone help me to solve this out?
asked Jan 10, 2019 at 6:42
Pratik Rathod
411 gold badge1 silver badge7 bronze badges
2 Answers 2
Use the decodeURI() function
console.log(decodeURIComponent('hundeausf%C3%BChrer'));
>>hundeausführer
Sign up to request clarification or add additional context in comments.
Comments
This works for me.
console.log(decodeURI('hundeausf%C3%BChrer'));
answered Jan 10, 2019 at 6:47
Deepak Preman
1131 silver badge11 bronze badges
Comments
lang-js
escapefor? Just decode.