title: How do I read and write UTF-8 encoding from java assets folder? I have the code, but its not working. I get �D�nde est� / D�nde
body: <pre><code>  private void CopyAssets2() {
      AssetManager assetManager = getAssets();
      String[] files = null;
      try {
          files = assetManager.list("");
      } catch (IOException e) {
          Log.e("File Error", e.getMessage());
      }
      for (String filename : files) {
          InputStream in = null;
          OutputStream out = null;
          try {
              in = assetManager.open(filename);
              out = new FileOutputStream("/sdcard/Translate/" + filename);
              copyFile2(in, out);
              in.close();
              in = null;
              out.flush();
              out.close();
              out = null;
          } catch (Exception e) {
              Log.e("Save Error", e.getMessage());
          }
      }
  }
  
  private void copyFile2(InputStream in, OutputStream out)
              throws IOException {
      char[] buffer = new char[1024];
      Reader reader = new BufferedReader( new InputStreamReader(in, "UTF-8"));
  
      Writer writer = new BufferedWriter(new OutputStreamWriter(out, "UTF-8"));
  
      int read;
      while ((read = reader.read(buffer)) != -1) {
          writer.write(buffer, 0, read);
      }
      reader.close();
      writer.flush();
      writer.close();
  }
  </code></pre>
  
  <p>Im getting the inputstream with assetManager, and passing it as a parameter of reader with UTF-8 encoding specified. 
  I'm also doing writing to the outputstream filepath with writer in UTF-8</p>
  
  <p>The file is read and written, but the encoding is still wrong. I get characters like these: 
  Where are... =  �D�nde est� / D�nde</p>
  
  <p>What I am doing wrong?</p>