Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

209
Vistas
How to check if the special character I'm seeing is indeed what I'm seeing or it's just an HTML entity in disguise?

I have a div containing a string which is a Cypher query:

<div id="foo">match (n)-[r]-() where n.gid='Cx' return n,r</div>

Since the ' character will be encoded as &#8217;, and since Cypher query isn't able to automatically decode it, I need to make sure whether the ' character I see (and Cypher sees as well) is really the ' character, not just &#8217; but the browser automatically transforms it to '.

In all the places the character is always showed as '; the only place it's really show its true evil is in the HTML view-source page. I try using a solution from What's the right way to decode a string that has special HTML entities in it?:

function decodeHtml(html) {
    var txt = document.createElement("textarea");
    txt.innerHTML = html;
    return txt.value;
}

But Cypher still doesn't accept it. But I guess I cannot check when the string is still encoded or not, because anywhere I go, the browser will always show the decoded version.

Another problem is when I add this into the console:

string = document.getElementById('foo').innerText
string.includes("'") //false
string.includes("&") //false

If it return false in both case, then what exactly the version of the character in there? Is it the decoded or encoded version?

Related: Can Cypher interpret HTML character codes as input?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda