title: java utf8 encoding outputstream not working
body: <p>I need to write a program which is able to write UTF-8 data into a file.</p>
  
  <p>I found out examples on the internet, however, I am not able to progress to desired result.</p>
  
  <p>Code:</p>
  
  <pre><code>import java.io.BufferedWriter;
  import java.io.FileOutputStream;
  import java.io.OutputStreamWriter;
  import java.io.Writer;
  
  public class UTF8WriterDemo {
  
      public static void main(String[] args) {
          Writer out = null;
          try {
              out = new BufferedWriter(
                      new OutputStreamWriter(new FileOutputStream("c://java//temp.txt"), "UTF-8"));
  
  
              String text = "This texáát will be added to File !!";
  
              out.write(text);
              out.close();
          } catch (Exception e) {
              e.printStackTrace();
          }
  
      }
  
  }
  </code></pre>
  
  <p>Everything run succesfully, but at the end I see special characters not showing properly: 
  This texÃ¡Ã¡t will be added to File !!</p>
  
  <p>I tried several examples from the internet with the same result.</p>
  
  <p>I use Visual Studio code.</p>
  
  <p>Where could be the problem please?</p>
  
  <p>Thank you</p>