Hi all,
This line of code, which decodes an encoded Chinese word:
URLDecoder.decode("%E4%BB%BB%E4%BD%95%E8%BD%A6%E8%BE%86%E5%BA%94",
"UTF-8").getBytes().length
When I run it in a JSP page (on Jboss) it prints 5:
<%= URLDecoder.decode("%E4%BB%BB%E4%BD%95%E8%BD%A6%E8%BE%86%E5%BA%94",
"UTF-8").getBytes().length %>
Running it in a desktop application prints 15:
public static void main(String[] args) {
System.out.println(URLDecoder.decode(
"%E4%BB%BB%E4%BD%95%E8%BD%A6%E8%BE%86E5%BA%94", "UTF-8"
).getBytes().length);
}
Why? And I want the jsp to get 15 also, how?