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

346
Views
Convert unicode to html

In my application I have to use scientific unit such as m³/h. So that I store that Unicode in my database like m\u00b3/h. But the problem is, when I fetch data from API, it returns this with addition \ like "sign": "m\\u00b3/h". Is there any way to get rid off this issue.

I store the Unicode in DB like this: enter image description here

When I fetch this, It returns me like this: enter image description here

And I use this in my UI Like this: enter image description here enter image description here Please help.

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

0

x = 'm\\u00b3/h';
x.replace(/\/\//g, "") // should output m\u00b3/h

Also, if you want to convert unicode to HTML, use this

x = 'm\\u00b3/h';
JSON.parse('"' + x + '"') // Should output 'm³/h'
about 4 years ago · Juan Pablo Isaza Report

0

That extra \ it's just to escape that special character from JSON. If you're using a JSON library, it will escape it automatically.

If not you can use this:

('m\\u00b3/h').replace('\\\\', '\\');
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!