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

204
Vistas
JS code can't return text with non-latin characters

I've written a simple code that finds the first and last name in the URL and returns them as text and I've been using it as titles for personal pages. Everything works perfectly except if name is written in the non-Latin alphabet (in my case Georgian) it returns seemingly random numbers.

if(window.location.href.includes("authorname")) {
 var strhtp = window.location.href;
 var sbthtp = strhtp .substring(strhtp .indexOf('=') + 1).replaceAll("+", " ");
 document.getElementById("filye").innerHTML = sbthtp;
}
<span id="filye"></span>

if URL includes authorname=John+Doe it returns normally, but if name is written in Georgian, for example authorname=ვაჟა+ფშაველა it returns seemingly random numbers:

%E1%83%90%E1%83%9A%E1%83%94%E1%83%A5%E1%83%A1%E1%83%90%E1%83%9C%E1%83%93%E1%83%A0%E1%83%94 %E1%83%99%E1%83%9D%E1%83%91%E1%83%94%E1%83%A0%E1%83%98%E1%83%AB%E1%83%94

The best outcome would be if the code was able to return non-Latin names normally. But if that isn't possible I'd like it if you'd help me to either (a) change all non-Latin characters to Latin equivalents or (b) code to return Latin names as text, but reject non-Latin names altogether and return nothing.

Thank you

about 4 years ago · Juan Pablo Isaza
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