title: How to use the file of UTF-8 format as a .srt file to show subtitle in mediaplayer?
body: <p>I face a problem in file writing. When I write Bangla and English in file using UTF-8 format, the file contains exactly that what I write.
  But the problem is when I am going to use this file as a .srt file to show subtitle of a video in a media player</p>
  
  <p>The mediaplayer can not show the bangla subtitle , instead of bangla word the media player show some english and some symbol....</p>
  
  <p>But when I copy the contents of my file (in which I write) to other file ,
  then using the other file, the media player can show exactly that what I write in file
  such as bangla, english .</p>
  
  <p>My question is Why the 1st file can not do the same thing as the 2nd file do.
  And how can I remove this problem in code that I can use the 1st file.</p>
  
  <pre><code>BufferedWriter out = new BufferedWriter(
         new OutputStreamWriter(
                    new FileOutputStream(file), "UTF8"));
        int size=1;
        for(Tableclass variable:tablevector)
        {
              out.write(String.valueOf(size));
              out.newLine();
              out.write(variable.Starttime);
              out.write(" --&gt; ");
              out.write(variable.Endtime);
              out.newLine();
              out.write(variable.Text);
              out.newLine();
              out.newLine();
            // output.format("%d\n%s --&gt; %s\n%s\n\n",size,variable.Starttime,variable.Endtime,variable.Text);
  
          size++;
        }
        out.close();
  </code></pre>