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

208
Views
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
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!