title: Difference in URL decode/encode UTF-8 between Java and JS/AS3 (bug!?)
body: <p>I am having an issue URL decoding a UTF-8 string in Java that is encoded either with Javascript or Actionscript 3. I've set up a test case as follows:</p>
  
  <p>The string in question is Produktgröße</p>
  
  <p>When I encode with JS/AS3 I get the following string:</p>
  
  <pre><code>escape('Produktgröße')
  </code></pre>
  
  <p>Produktgr%F6%DFe</p>
  
  <p>When I unescape this with JS I get no change</p>
  
  <pre><code>unescape('Produktgr%F6%DFe')
  </code></pre>
  
  <p>Produktgr%F6%DFe</p>
  
  <p>So, by this I assume that JS isn't encoding the string properly??</p>
  
  <p>The following JSP produces this outupt</p>
  
  <pre><code>&lt;%@page import="java.net.URLEncoder"%&gt;
  &lt;%@page import="java.net.URLDecoder"%&gt;
  &lt;%=(URLDecoder.decode("Produktgr%F6%DFe","UTF-8"))%&gt;&lt;br/&gt;
  &lt;%=(URLEncoder.encode("Produktgröße","UTF-8"))%&gt;&lt;br/&gt;
  &lt;%=(URLEncoder.encode("Produktgröße"))%&gt;&lt;br/&gt;
  &lt;%=(URLDecoder.decode(URLEncoder.encode("Produktgröße")))%&gt;&lt;br/&gt;
  &lt;%=(URLDecoder.decode(URLEncoder.encode("Produktgröße"),"UTF-8"))%&gt;&lt;br/&gt;
  </code></pre>
  
  <p>Produktgr?e</p>
  
  <p>Produktgr%C3%B6%C3%9Fe</p>
  
  <p>Produktgr%C3%B6%C3%9Fe</p>
  
  <p>Produktgröße</p>
  
  <p>Produktgröße</p>
  
  <p>Any idea why I'm having this disparity with the languages and why JS/AS3 isn't behaving as I expect it to?</p>
  
  <p>Thanks.</p>