title: How to encode and decode characters in the right way
body: <p>I'm working on a web site in which the encoding used is <code>UTF-8</code>.
  The server side is developed with Java and the database uses <code>Windows-1252</code> encoding.</p>
  
  <p>How do I encode the characters correctly so they can be displayed correctly both in the database viewer and on the client side?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Here is the code:</p>
  
  <pre><code>Class.forName("com.pervasive.jdbc.v2.Driver");
  
  Connection conn = DriverManager.getConnection("jdbc:pervasive://XXX.XXX.XXX.XXX/TEST","xxxx", "xxxxx");
  
  Statement stmt = conn.createStatement();
  
  String sql = "INSERT INTO MyTest (COL1, COL2) VALUES (99999, 'Ó 456789 ñÑ; ° - + ( _ . - / \\ &amp; &lt;' )";
  stmt.executeUpdate(sql);
  </code></pre>
  
  <p>The database viewer shows: <code>? 456789 ??; ? - + ( _ . - / \\ &amp; &lt;</code> instead of <code>Ó 456789 ñÑ; ° - + ( _ . - / \\ &amp; &lt;</code> </p>
  
  <p>The String <code>? 456789 ??; ? - + ( _ . - / \\ &amp; &lt;</code> is retrieved when <code>SELECT</code> is excecuted</p>