-
1. Re: Weld2.0.0+tomcat7.0.40+jsf2.0.2 could not support utf8?
mkouba May 20, 2013 3:38 AM (in response to tonybear)Hi Tony,
could you provide some more information? E.g. what does it mean "utf-8 support"? Some code snippets would be useful as well...
-
2. Re: Weld2.0.0+tomcat7.0.40+jsf2.0.2 could not support utf8?
tonybear May 21, 2013 12:17 AM (in response to mkouba)Thanks you help,
web.xml:
--------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<display-name>Weld Test</display-name>
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>
<listener>
<listener-class>org.jboss.weld.environment.servlet.Listener</listener-class>
</listener><servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet><servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping><session-config>
<session-timeout>10</session-timeout>
</session-config>
</web-app>
project libtest program
test:
result:
--------------weld测试
set usernameweld???è??
----------------这个打印出来的字符-------------
weld???è??
11111please give me suggestions,Thanks.
-
3. Re: Weld2.0.0+tomcat7.0.40+jsf2.0.2 could not support utf8?
mkouba May 21, 2013 10:11 AM (in response to tonybear)Tony,
your problem seems to be weld-unrelated and the code does not make sense, in other words the output is expected - if you call "some accented chars".getBytes("ISO-8859-1") any unknown character is replaced with question mark...