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

67
Visualizações
Unicode character in propertyname

I need a response from a public API that contains the letter ø (\u00f8). I'm using angular, and I use an interface to make my responses typed.

export interface Response{
  øl: string; // instead of ø I would like to use \u00f8 (or something similiar)  
}

The problem is I have some international coworkers that do not have ø in their alphabet. Creating strings with Unicode is easy, but how can I do it with property names?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

The answer is "Yes they can use unicode entities instead of the characters they cannot type"

In your case they could use \u00F8 for ø

const response = {
"øl":"🍺",
"b\u00C6":"💩",
"💩": "b\u00E6",
"f\u00F8l": "🐎"
}
console.log(response["\u00F8l"])
console.log(response["øl"])
console.log(response["💩"])
console.log(response["føl"])

console.log(Object.entries(response)
  .filter(([key,value]) => key.includes("\u00F8")))
  
  console.log(Object.entries(response)
  .filter(([key,value]) => key.includes("ø")))

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