title: Utf-8 encoding for Android
body: <p>i have a problem with utf-8 encoding.  </p>
  
  <p>I retrieve from a MySQL Database data formatted in UTF-8 (with a lot of chinese symbols) with Java and i put them on some txt files: (this is an example.. i have a lot of data)</p>
  
  <pre><code>String name = null;
  ResultSet res = stat.executeQuery("Some_SQL");
  nomeImg = res.getString("value");
  
  PrintWriter = new new PrintWriter(new FileOutputStream("file_name.txt"));
  out.println(name);
  </code></pre>
  
  <p>with these txt files i will create some TextView that i use to populate some Activities on my Android App but, not all the symbols are correctly displayed: the most of them are correct, but some are not recognized and the're shown as a black diamond with a white question mark inside.</p>
  
  <p>i've also tried with this: but i got worst results</p>
  
  <pre><code>byte[] name = null;
  ResultSet res = stat.executeQuery("Some_SQL");
  nomeImg = res.getString("value").getBytes("UTF-8"):
  
  BufferedWriter = new BufferedWriter(new OutputStreamWriter(new FileOutputStream("file_name.txt"), "UTF-8"));
  out.write(new String(name, "UTF-8")+"\n");
  </code></pre>
  
  <p>Does anyone have any idea?
  thanks!</p>
  
  <p><strong>edit</strong>
  i connect to my DB with:</p>
  
  <pre><code>Connection con = DriverManager.getConnection("jdbc:mysql://url:port?useUnicode=true&amp;characterEncoding=utf-8", user, pass);
  </code></pre>
  
  <p>and when i execute on the DB the query:</p>
  
  <pre><code>SELECT default_character_set_name 
  FROM information_schema.SCHEMATA S 
  WHERE schema_name = "schema_name";
  </code></pre>
  
  <p>i get the result</p>
  
  <pre><code>utf8
  </code></pre>
  
  <p>so i think that DB is encoded in UTF-8 and my connection to it can handle UTF-8</p>