3

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?

1
  • 3
    Whats the escape for? Just decode. Commented Jan 10, 2019 at 6:44

2 Answers 2

6

Use the decodeURI() function

console.log(decodeURIComponent('hundeausf%C3%BChrer'));

>>hundeausführer
Sign up to request clarification or add additional context in comments.

Comments

2

This works for me.

console.log(decodeURI('hundeausf%C3%BChrer'));

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.