title: How to encode a string in UTF-8 from a ResultSet encoded in latin1
body: <p>I'm writing an application (uses UTF-8) that need read/write to a second database of an external application (uses ISO-8859-1).</p>
  
  <pre class="lang-java prettyprint-override"><code>try {
      // data in latin1
      String s = rs.getString("sAddrNameF");
      System.out.println(s); // shows "Adresse d'exp�dition"
      byte[] data = s.getBytes();
      String value = new String(data, "UTF-8");
      System.out.println("data in UTF8: " + value);
      // The expected result should be "Adresse d'expédition"
  } catch (UnsupportedEncodingException e) {
      e.printStackTrace();
  }
  </code></pre>
  
  <p>This code is not working, I also still need do the opposite conversion (writing on the database). If anybody know an elegant solution to dealing with different encoding in the same application please let me know, I appreciate it. </p>