About Oleg Varaksin
I spent many hours today to figure out how to force a proper decoding of encoded characters in JSF applications running on JBoss (using JBoss 7 Final). The problem occurs when you have e.g. chinese characters passed through URL. Assume you have 指事, encoded as %E6%8C%87%E4%BA%8B. Surprise, but these characters arrive you on the server-side as 指事. They are decoded by server automatically with ISO-8859-1. So, it doesn’t matter if you try to decode it by yourself like:
FacesContext fc = FacesContext.getCurrentInstance();String param = fc.getExternalContext().getRequestParameterMap().get(name);String decodedParam = java.net.URLDecoder.decode(param, "UTF-8");
It doesn’t help because characters were already wrong decoded and you get them already wrong decoded from the request parameter map. It doesn’t help too if you have on the page
Source : http://www.javacodegeeks.com/2013/07/proper-decoding-of-url-parameters-on-the-server-side-in-jboss.html