title: How can I replace non-printable Unicode characters in Java?
body: <p>The following will replace ASCII control characters (shorthand for <code>[\x00-\x1F\x7F]</code>):</p>
  
  <pre><code>my_string.replaceAll("\\p{Cntrl}", "?");
  </code></pre>
  
  <p>The following will replace all ASCII non-printable characters (shorthand for <code>[\p{Graph}\x20]</code>), including accented characters:</p>
  
  <pre><code>my_string.replaceAll("[^\\p{Print}]", "?");
  </code></pre>
  
  <p>However, neither works for Unicode strings. Does anyone has a good way to remove non-printable characters from a unicode string?</p>