title: How to add a UTF-8 BOM in Java?
body: <p>I have a Java stored procedure which fetches record from the table using <code>Resultset</code> object and creates a CS Vfile.</p>
  
  <pre><code>BLOB retBLOB = BLOB.createTemporary(conn, true, BLOB.DURATION_SESSION);
  retBLOB.open(BLOB.MODE_READWRITE);
  OutputStream bOut = retBLOB.setBinaryStream(0L);
  
  ZipOutputStream zipOut = new ZipOutputStream(bOut);
  PrintStream out = new PrintStream(zipOut,false,"UTF-8");
  out.write('\ufeff');
  out.flush();
  
  zipOut.putNextEntry(new ZipEntry("filename.csv"));
  while (rs.next()){
      out.print("\"" + rs.getString(i) + "\"");
      out.print(",");
  }
  out.flush();
  
  zipOut.closeEntry();
  zipOut.close();
  retBLOB.close();
  
  return retBLOB;
  </code></pre>
  
  <p>But the generated CSV file doesn't show the correct German character. Oracle database also has a <code>NLS_CHARACTERSET</code> value of UTF8.</p>
  
  <p>Please suggest.</p>