Reading UTF-8 file and writing plain ANSI?
<p>I have an UTF-8 file (it's a csv).<br>
I need to read line by line this file do some replace and then write line by line into another file.</p>

<pre><code>    BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(
        new FileOutputStream(fileFix), "ASCII")
    );
    bw.write("");   //clean current file


    BufferedReader br = new BufferedReader(new InputStreamReader(
        new FileInputStream(file),"UTF-8")
    );

    String line;
    while ((line = br.readLine()) != null) {
        line = line.replace(";", ",");
        bw.append(line + "\n");
    }
</code></pre>

<p>Simple as that.<br>
The problem is that the output file (fileFix) is UTF-8 and i think it has the BOM character.</p>

<p>How can I write the file as plain ANSI without the BOM?</p>

<p>The error I am getting while reading my file with a software (weka)</p>

<p><img src="http://i.stack.imgur.com/YygWl.png" alt="enter image description here"></p>

<p>The first line of this file:</p>

<p><img src="http://i.stack.imgur.com/bErW8.png" alt="enter image description here"></p>

<p>Consider that notepad++ tells me the charset is UTF-8. If i try to convert this file in plain ASCII (with windows notepad), that chars disappers</p>

<h2>Solution</h2>

<p>When you are on the first line run:</p>

<pre><code>line = line.substring(1);
</code></pre>

<p>To remove any BOM char.</p>
