title: How to save text file with UTF-8 encoding in java?
body: <p>I am facing a problem in saving a text file in UTF-8 format using java. When i click on save as for the generated text file, it gives ANSI as text format but not as UTF-8. Below is the code i am writing while creating the file:</p>
  
  <pre><code>    String excelFile="";
  
      excelFile = getFullFilePath(fileName);
      File file = new File(excelFile + fileName,"UTF-8");
      File output = new File(excelFile,"UTF-8");
  
      FileUtils.writeStringToFile(file, content, "UTF-8");
  </code></pre>
  
  <p>While creating the text file, I am using UTF-8 encoding, but the file still shows the encoding as ANSI while saving.
  Kindly help.</p>