title: Invisible character leads to Unexpected EOF error
body: <p>While trying to handle a string I am facing</p>
  
  <blockquote>
    <p>Error: SyntaxError: Unexpected EOF</p>
  </blockquote>
  
  <p>I have no control on how the string is generated.  I managed to isolate the problematic character(s) by dichotomy with <code>substring()</code>, however it doesn't get printed either by <code>console.log()</code> or by <code>JSON.parse()</code> : I get</p>
  
  <pre><code>&gt; console.log(c);
  ""
  &gt; JSON.parse(c);
  ""
  </code></pre>
  
  <p>yet</p>
  
  <pre><code>&gt; c.length;
  1
  </code></pre>
  
  <p>All I know is that it is followed by a <code>\n</code>.</p>
  
  <p>How can I identify it and get rid of it ?</p>
  
  <h2>Update</h2>
  
  <pre><code>&gt; console.log(encodeURIComponent(c));
  %E2%80%A8
  </code></pre>
  
  <p><a href="https://www.w3schools.com/tags/ref_urlencode.asp" rel="nofollow noreferrer">Is this even a character ??</a></p>