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

313
Visualizações
Extended ASCII character ° not working as a dictionary key

For whatever the reason, I need a dictionary key with the character "°". The dictionary is declared the most straightforward way possible in a javascript file :

var myDict = {
    "Angle °": 150
};

Unfortunately, when iterating over my elements and comparing the keys, the equality evaluation with this specific key doesn't work.

In Chrome console, showing the dictionary keys with Object.Keys(myDict); shows this key with a specific question mark � instead of °.

However, when the dictionary is created the exact same way, directly in the Chrome console, everything is working well, that's why I cannot give an example snippet.

I have tried both this solutions :

  • Adding charset = "UTF-8" to the <script> tag.
  • Adding <meta charset="UTF-8"> in <head>.
about 4 years ago · Juan Pablo Isaza
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