title: How to replace non-printable unicode characters (Javascript)
body: <p>I've already wasted a good amount of time dealing with strings (generated by some other source) and I found out that the problem was that the strings have non-printable characters. Today I am dealing with javascript. Does anyone know how to replace non-printable unicode characters in javascript?</p>
  
  <p>I found something similar here:</p>
  
  <p><a href="https://stackoverflow.com/questions/6198986/how-can-i-replace-non-printable-unicode-characters-in-java">How can I replace non-printable Unicode characters in Java?</a></p>
  
  <blockquote>
    <p><code>my_string.replaceAll("\\p{C}", "?");</code></p>
  </blockquote>
  
  <p>and here:</p>
  
  <p><a href="https://stackoverflow.com/questions/7747271/non-ascii-characters-added-form-input-only-with-safari-browser">Non-ascii characters added form input only with Safari Browser</a></p>
  
  <blockquote>
    <p><code>filename.replace(/[^a-z0-9\.]+/gi, "");</code></p>
  </blockquote>
  
  <p>The last option replaces all the characters that are not in the brackets. This is something that has always comes to bite me in my rear end no matter what language I'm working on and I'm tired of trying to figure out what characters are messing up my code. For this reason I want to be able to replace all those invisible characters for something visible so that I can later remove them completely.</p>