Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>It's probably the <a href="http://en.wikipedia.org/wiki/Null_character" rel="nofollow noreferrer">NULL character</a> which is represented by <code>\0</code>. You can get rid of it by <a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html#trim%28%29" rel="nofollow noreferrer"><code>String#trim()</code></a>.</p> <p>To nail down the exact codepoint, do so:</p> <pre><code>for (char c : string.toCharArray()) { System.out.printf("U+%04x ", (int) c); } </code></pre> <p>Then you can find the exact character <a href="http://www.fileformat.info/info/unicode/char/search.htm" rel="nofollow noreferrer">here</a>.</p> <hr> <p><strong>Update:</strong> as per the update:</p> <blockquote> <p>Anyone know of a way to just include a range of valid characters instead of excluding 95% of the UTF8 range?</p> </blockquote> <p>You can do that with help of regex. See the answer of @polygenelubricants here and <a href="https://stackoverflow.com/questions/3069634/does-anyone-know-some-java-class-that-return-a-operating-system-friendly-filename/3069681#3069681">this answer</a>.</p> <p>On the other hand, you can also just fix the problem in its root instead of workarounding it. Either update the files to get rid of the BOM mark, it's a legacy way to distinguish UTF-8 files from others which is nowadays worthless, or use a <code>Reader</code> which recognizes and skips the BOM. Also see <a href="https://stackoverflow.com/questions/1835430/byte-order-mark-screws-up-file-reading-in-java">this question</a>.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload