Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>It's the output console which doesn't support those characters. Since you're using Eclipse, you need to ensure that it's configured to use UTF-8 for this. You can do this by <em>Window > Preferences > General > Workspace > Text File Encoding > set to UTF-8</em>.</p> <h3>See also:</h3> <ul> <li><a href="http://balusc.blogspot.com/2009/05/unicode-how-to-get-characters-right.html" rel="nofollow noreferrer">Unicode - How to get the characters right?</a></li> </ul> <hr> <p><strong>Update</strong> as per the updated question and the comments, apparently the <a href="http://en.wikipedia.org/wiki/Byte_order_mark" rel="nofollow noreferrer">UTF-8 BOM</a> is the culprit. Notepad by default adds the UTF-8 BOM on save. It look like that the JRE on your HTC doesn't swallow that. You may want to consider to use the <code>UnicodeReader</code> example as outlined in <a href="https://stackoverflow.com/questions/1888189/java-readers-and-encodings/1888284#1888284">this answer</a> instead of <code>InputStreamReader</code> in your code. It autodetects and skips the BOM.</p> <pre><code>FileInputStream fis = new FileInputStream(new File(fileName)); UnicodeReader ur = new UnicodeReader(fis, "UTF-8"); BufferedReader in = new BufferedReader(ur); </code></pre> <hr> <p>Unrelated to the actual problem, it's a good practice to close resources in <code>finally</code> block so that you ensure that they will be closed in case of exceptions.</p> <pre><code>BufferedReader reader = null; try { reader = new BufferedReader(new UnicodeReader(new FileInputStream(fileName), "UTF-8")); // ... } finally { if (reader != null) try { reader.close(); } catch (IOException logOrIgnore) {} } </code></pre> <p>Also unrelated, I'd suggest to put <code>Pattern p = Pattern.compile(",");</code> outside the loop, or even make it a static constant, because it's relatively expensive to compile it and it's unnecessary to do this everytime inside a loop.</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