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

203
Views
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
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!