Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

208
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda