Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

342
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda