Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

209
Views
How to properly unescape non-ASCII cahracters in location.pathname

I have the following URL in the browser address bar:

example.com/search/city/Germany:Baden-Württemberg

From the console I try to get the pathname of the URL:

location.pathname which returns:

/search/city/Germany:Baden-W%C3%BCrttemberg

I see that the ü character has been transformed (escaped) to %C3%BC sequence. I want to dysplay this character as is in the HTML document, therefore I tryed with unescapeing it:

unescape(location.pathname) but unfortunatelly what I get is not the string from the URL > '/search/city/Germany:Baden-Württemberg'

How can I get the URL character ü (from my URL example.com/search/city/Germany:Baden-Württemberg ) via Javascript ?

Thank you!

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The solution pointed out by @Cid

Use decodeURI()

worked better in this case than unescape which seems not to be the preferred function for such translations.

From developer.mozilla.org

Usually, decodeURI or decodeURIComponent are preferred over unescape.

Again, all the credits of this answer go to @Cid for his comments on the original questions.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!