title: Load Html file with UTF8 encoding from assets into a TextView
body: <p>I have HTML file in assets folder which is encoded in UTF8(contain Persian characters), I want to read this file and load it into a TextView.I read lots of posts like <a href="https://stackoverflow.com/questions/4964640/reading-inputstream-as-utf-8">load utf-8 text file</a> , <a href="http://adilatwork.blogspot.it/2013/03/android-load-and-show-html-from-file.html" rel="nofollow noreferrer">load HTML file into TextView</a> , <a href="https://stackoverflow.com/questions/14335166/read-raw-file-with-unicode-characters">read UTF8 text file from res/raw</a> and write this code:</p>
  <pre><code>try{
          InputStream inputStream = getResources().getAssets().open(&quot;htmls/salamati.html&quot;);
          // I also try &quot;UTF-8&quot; but none of them worked
          BufferedReader r = new BufferedReader(new InputStreamReader(inputStream,&quot;UTF8&quot;));
          StringBuilder total = new StringBuilder();
          String html;
          while ((html = r.readLine()) != null) {
              total.append(html);
          }
          // total contains incorrect characters
          textView.setText(Html.fromHtml(total.toString()));
      }
      catch (IOException exception)
      {
          textView.setText(&quot;Failed loading HTML.&quot;);
      }
  </code></pre>
  <p>But It show incorrect characters!
  I also try to convert total.toString() into a UTF8 String array and then add it to textView but it didn't work too</p>
  <pre><code>textView.setText(Html.fromHtml(new String(total.toString().getBytes(&quot;ISO-8859-1&quot;), &quot;UTF-8&quot;)));
  </code></pre>
  <p>There is no problem with textView or emulator because when I load HTML from Database, It shows utf8 characters correctly!
  So what should I do?</p>