title: How to handle string encoding in java?
body: <p>I was really discouraged by java's string encoding.
  There are many auto conversions in it. and I can't found the regular.
  Anyone have good idea?
  for example:
  In a jsp page, it has such link</p>
  
  <pre><code>http://localhost:8080/helloworld/hello?world=凹ㄉ
  </code></pre>
  
  <p>And then we need to process it, so we do this:</p>
  
  <pre><code>String a = new String(request.getParameter("world").toString().getBytes("ISO-8859-1"), 
                        "UTF-8");
  a = "http://localhost/" + a;
  </code></pre>
  
  <p>And when I debug it, I found a is right. </p>
  
  <p>And then I pass this to a session object:
  request.getSession().setAttribute("hello", a);</p>
  
  <p>Later in a jsp page with encoding "Big5", and i try to get the attribute and display, 
  And i found the characters "凹ㄉ"  are corrupted.</p>
  
  <p>How can I solve this?</p>