I have a problem decrypting the URL of a UTF-8 string in Java, which is encoded either using Javascript or ActionScript 3. I installed a test case as follows:
This line contains Produktgröße
When I encode JS / AS3, I get the following line:
escape('Produktgröße')
Produktgr% F6% DFe
When I unescape this with JS, I don't get any changes
unescape('Produktgr%F6%DFe')
Produktgr% F6% DFe
So, by this, I assume that JS is not encoding the string correctly ??
Next jsp creates this outupt
<%@page import="java.net.URLEncoder"%>
<%@page import="java.net.URLDecoder"%>
<%=(URLDecoder.decode("Produktgr%F6%DFe","UTF-8"))%><br/>
<%=(URLEncoder.encode("Produktgröße","UTF-8"))%><br/>
<%=(URLEncoder.encode("Produktgröße"))%><br/>
<%=(URLDecoder.decode(URLEncoder.encode("Produktgröße")))%><br/>
<%=(URLDecoder.decode(URLEncoder.encode("Produktgröße"),"UTF-8"))%><br/>
Produktgr? E
Produktgr% C3% B6% C3% 9Fe
Produktgr% C3% B6% C3% 9Fe
Produktgröße
Produktgröße
Any idea why I have such a mismatch with languages and why JS / AS3 doesn't behave as I expect?
Thank.