title: Passing special characters via apache HTTPClient
body: <p>I have a servlet which accepts HTML content as part of the request param. The HTML is a localized one which may be a french, spanish etc... content. 
  I'm also using apache HTTP client to make a request to this servlet for test purpose, which has the following header definition:</p>
  
  <pre><code>HttpClient client = new HttpClient();
  
  PostMethod method = new PostMethod("&lt;URL&gt;");
  String html = FileUtils.readFileToString(inputHTMLFile, "UTF-8");
  method.addParameter("html", html);
  
  method.addRequestHeader("Accept", "*/*");    
  method.setRequestHeader("accept-charset", "UTF-8");
  </code></pre>
  
  <p>Whatever HTML is read has the character encoding utf-8, sample text:</p>
  
  <pre><code>Télécharger un fichier
  </code></pre>
  
  <p>However when i get the html from the request param that texts becomes <code>T?l?charger un fichier</code></p>
  
  <p>I went through few links such as <a href="http://www.oracle.com/technetwork/articles/javase/httpcharset-142283.html" rel="nofollow">http://www.oracle.com/technetwork/articles/javase/httpcharset-142283.html</a> which talks about charset and how normally a browser would encode the special characters. If i were to URLEncode the html with UTF-8 and then decode that with same charset in the servlet i get the HTML as expected.</p>
  
  <p>Is this the only thing i can do to preserve the charsets? Am i missing something? </p>
  
  <p>Thanks.</p>