title: How to write a UTF-8 file with Java?
body: <p>I have some current code and the problem is its creating a 1252 codepage file, i want to force it to create a UTF-8 file</p>
  
  <p>Can anyone help me with this code, as i say it currently works... but i need to force the save on utf.. can i pass a parameter or something??</p>
  
  <p>this is what i have, any help really appreciated</p>
  
  <pre><code>var out = new java.io.FileWriter( new java.io.File( path )),
          text = new java.lang.String( src || "" );
      out.write( text, 0, text.length() );
      out.flush();
      out.close();
  </code></pre>