2008/9/11 Willem Moors <[EMAIL PROTECTED]>:
> I studied the Response Headers for the ajax call that generates the output
> and found that for the correct result (ie. in TC55), the content type was
> this:
> Content-Type    text/plain;charset=ISO-8859-1
>
> while for the wrong result (ie. in TC6), the content type was:
> Content-Type    text/plain
>
>
> So I added this line to my code :
> response.setCharacterEncoding("ISO-8859-15");
> (I chose the ISO-..-15 set, to see if my change had effect)
>
> And lo and behold: problem solved !
>
> So would this be the right conclusion : it's TC55 that's wrong here and not
> TC 6 ?
> TC55 slaps on the 'charset=ISO-8859-1' by default and TC 6 doesn't.
>
> Anyway, glad to have found the solution, thank you all for chipping in
> your ideas!
>
Hi, Willem!

Glad to hear, that you solved this.

By the way, I think it is not Tomcat, but the browser that is confused when the
encoding is not specified in the Content-Type header.

Those question marks were '? in a romb' i.e. Unicode replacement symbol. I.e.
as if those were replaced at the browser side. When PrintWriter replaces
symbols, it prints '?' punctuation mark.

Is it true, that the Content-Type header of your Ajax responses now has
the ";charset=..." suffix? (Is Content-Type updated from your
setCharacterEncoding(), or not?)

Also, I have heard that Ajax responses that are read through XmlHttpRequest
are expected to be in UTF-8. E.g., mentioned here:
http://dojotoolkit.org/book/dojo-book-0-9/part-3-programmatic-dijit-and-dojo/i18n/encoding-considerations

Also, your HTML pages do not specify their charset explicitly, thus the
browser has to autodetect their encoding,
http://www.w3.org/TR/html4/charset.html#spec-char-encoding

Also, Tomcat wiki:
http://wiki.apache.org/tomcat/FAQ/CharacterEncoding

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to