Hi Paul,

You may find you need a CharsetFilter:

public void doFilter(final ServletRequest request, final ServletResponse
response, final FilterChain chain) throws IOException, ServletException {
   request.setCharacterEncoding(encoding);
   chain.doFilter(request, response);
}

I tried using the <locale-encoding-mapping-list> in web.xml but really had
no joy until I added the CharsetFilter.

Ref: http://wiki.apache.org/tomcat/Tomcat/UTF-8



-----Original Message-----
From: Paul Pogonyshev [mailto:[EMAIL PROTECTED] 
Sent: Saturday, 18 November 2006 2:36 AM
To: [email protected]
Cc: Jeff Bischoff
Subject: Re: charset problem

I wrote:
> Jeff Bischoff wrote:
> > I haven't had any trouble using UTF-8 so far. Can you confirm that you 
> > have the following in your pages:
> > 
> > <%@ page contentType="text/html; charset=utf-8" language="java" %>
> > ...
> > <head>
> >    ...
> >    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
> > </head>
> >
> > I'm pretty sure you need both.
> 
> Yes, I do have both.
> 
> > Can you be more specific about your problem? What do you mean by 
> > "characters from Java code"?
> 
> Actually, those include both characters from Java code and simply coded
> in in the page, e.g.
> 
>       абвгд
>       <%= "абвгд" %>
> 
> both produce HTML-entities, even though Cyrillic letters are encodable
> in UTF-8.  This is not a problem in HTML parts (except for increased
> page size), but is not appropriate in JavaScript.

Here is a simple page to check this (but I admit this might be a local
problem or JSP/JSF combination problem):

<%@ page
    contentType="text/html; charset=UTF-8"
    language="java"
%>
<%@ include file="/base/taglibInclude.jsp" %>
<html>
<head>
<title>test</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
</head>
<body>
  абвгд
  <%= "абвгд" %>
<f:view>
  абвгд
  <%= "абвгд" %>
</f:view>
  абвгд
  <%= "абвгд" %>
</body>
</html>


Reply via email to