I tried all possible answers of this and, but that did not work for me. Now write a question.
private String convertValue(String val){ System.out.println("convert input:" + val); String res = ""; StringTokenizer st = new StringTokenizer(val,","); while(st.hasMoreTokens()){ String token = st.nextToken(); if (token.matches("([0-9]*)")) { char c = (char)Integer.parseInt(token); res+=c; }else{ res+=token; } } System.out.println("convert output:" + res); return res; }
When jboss 7 ends, it gives:
convert input:61,1087,1088,1080,1074,1077,1090 convert output:=
Running in jboss 7 action:
convert input:61,1087,1088,1080,1074,1077,1090 convert output:=??????
Why is it not working properly?
My standalone.xml:
<extension module="org.jboss.as.weld"/> </extensions> <system-properties> <property name="org.apache.catalina.connector.URI_ENCODING" value="UTF-8"/> <property name="org.apache.catalina.connector.USE_BODY_ENCODING_FOR_QUERY_STRING" value="true"/> </system-properties>
added java opts (-Dfile.encoding = UTF-8):
convert input:61,1087,1088,1080,1074,1077,1090 convert output:=βΓΈβΓββββ€βΒ΅βΓ
EDIT 1: My environment:
Mac OS X Version 10.7.5 JBoss 7.1.1.Final java version "1.6.0_33" Java(TM) SE Runtime Environment (build 1.6.0_33-b03-424-11M3720) Java HotSpot(TM) 64-Bit Server VM (build 20.8-b03-424, mixed mode)
EDIT 2: The code snippet above works in javax.enterprise.context.RequestScoped back bean when a button is clicked on a JSF page.