title: windows-1252 to UTF-8
body: <p>Below is the code I am trying to use, and the output it's giving me is:</p>
  
  <pre><code>RetValue: á, é, í, ó, ú, ü, ñ, ¿ Value: á, é, í, ó, ú, ü, ñ, ¿ ConvertValue: ?, ?, ?, ?, ?, ?, ?, ?
  </code></pre>
  
  <p>which is not the desired output. I think the output should be something of this kind %C3% for every character here.</p>
  
  <pre><code>public static void main(String[] args) {
      String value = "á, é, í, ó, ú, ü, ñ, ¿";
      String retValue = "";
      String convertValue = "";
      try {
          retValue = new String(value.getBytes(),
          Charset.forName("Windows-1252"));
          convertValue = new String(retValue.getBytes("Windows-1252"),
          Charset.forName("UTF-8"));
      } catch (Exception e) {
          e.printStackTrace();
      }
      System.out.println("RetValue: " + retValue + " Value: " + value
           + " ConvertValue: " + convertValue);
  }
  </code></pre>