J.Patterson Waltz III <lists 'at' cerenit.com> writes:

> On 6 janv. 05, at 15:52, J.Patterson Waltz III wrote:
> >
> >
> > Now, I guess I'll just have to try using the character encoding
> > filter Guillaume recommended.
> 
> Ack! I'm about to pull my hair out over these encoding issues. I added
> the SetCharacterEncodingFilter from the Tomcat 5 distribution to my
> web application, with just enough mods to get some logging output from
> it so I'd know it was doing its thing.
> 
> So now I have the following in place to ensure incoming and outgoing
> UTF-8 encoding:
> - A <%@ page pageEncoding="UTF-8"
> contentType="text/html;charset=UTF-8" language="java" %> directive
> - an acceptCharset="UTF-8" attribute on <html:form> tags
> - an  enctype="application/x-www-form-urlencoded;charset=UTF-8"
> attribute on <html:form> tags
> - the SetCharacterEncodingFilter, configured to interpret UTF-8 no
> matter what
> 
> and yet I'm *still* getting non-decoded UTF-8 displayed in my pages
> (i.e. été is été).
> 
> Guillaume, did you actually get UTF-8 to work using the filter
> solution? If so, can you (or anyone) think of anything else I might
> have missed? Thanks in advance.

Yes, it works.

First, verify `tomcat->browser': please try to render your page
with "wget -S" to see precisely the headers (Content-Type must
specify UTF-8) and the contents (double-check the output is
UTF-8) (to verify your browser is not bugged).

Second, verify `browser->tomcat': use a proxy (or netcat in
listen mode) to precisely see what headers your browser is
sending (if you will use the filter to force UTF-8, that doesn't
matter much) and the encoding of the data. Typically, browsers
will encode in UTF-8 if the page containing the form was using
UTF-8 itself, but accept-charset can do no harm, but as you
noticed they don't set the charset in the Content-Type header
they use (according to mozilla's bugzilla, it's because it breaks
too many servers); but you have to double-check that (in my
experience, mozilla and MSIE do work).

-- 
Guillaume Cottenceau

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to