Some users of non-English browsers reported that non-ASCII characters were getting corrupted. Other users reported no problems. JAMWiki enables UTF-8 support by doing the following:
request.setCharacterEncoding("UTF-8");
response.setContentType("text/html; charset=utf-8");
However, some users were reporting that the encoding they saw was localized, indicating that the system was not setting the UTF-8 encoding properly. Most users, however, did not see this problem. It is also worth noting that the problem was not present with Tomcat5, but only seemed to occur with Tomcat4.
The source of the problem turned out to be the JSTL format library. The fmt:setBundle method was for some reason resetting the response encoding for users. Only users for whom an appropriate translation file existed would see this bug - thus, because an ApplicationResources_hu.properties file exists, a Hungarian user reported the problem. Because no ApplicationResources_pt.properties file exists, a Portugese user did not see the problem.
The solution to this problem was partially inspired by an mailing list message that indicated that setting the fmt:message bundle from the web.xml file caused the response encoding to be permanently set to a non-UTF-8 value. Additionally, using the fmt:setBundle tag ALSO reset the response encoding value. The solution was then to remove the following lines from web.xml:
<context-param>
<param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
<param-value>ApplicationResources</param-value>
</context-param>
The message resource bundle was then initialized using the following code:
<f:setBundle basename="ApplicationResources" />
<%
// must re-set the response header because the f:setBundle tag can sometimes override it
response.setContentType("text/html; charset=utf-8");
%>
This solution seems to have resolved the problem.
블로그 - entered with Mozilla Firefox / Windows XP / English (US).