Read this excellent tutorial
http://www.sitepoint.com/blogs/2006/03/15/do-you-know-your-character-encodings/
To change the encoding one must change the charset meta tag as in
<META  charset= from ASCII (7bit) or ISO-8859 (8bit) to UCS based encodings
UTF-8 (8 bit represenation of UCS)
UTF-16 (16 bit representation of UCS)
UTF-32 (32 bit representation of UCS)

Tak/
Martin

This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

----- Original Message ----- From: "Christian Hvitved" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, April 13, 2007 12:05 PM
Subject: Problem reading the Accept-Encoding header from a request


Hi support list

I am having a problem, with reading the Accept-Encoding header from a
request, which seems very simple.

I use Tomcat  6.0.10 on a dansih windows xp.

The problem arose when I was writing a special compression filter (I don't
want to use the one that ships with tomcat).
When the server recieves a http request containing an Accept-Encoding
header, the header is replaced with a header with the name ---------------
and value ----. The header name and value are just dashes.
I have tested this by creating a filter that prints out all the headers. The
code is shown at the end of the mail. The code prints out all the headers
sent in the request. Except if the Accept-Encoding header is present it is
replaced with dashes.
When I make a request without the Accept-Encoding header I don't see the
header just containing dashes.

I have even tried using another server (Trifork T4) It does the same to the
accept encoding header.

Searching for the answer I found a post on the same problem but without a
solution :(
http://mail-archives.apache.org/mod_mbox/tomcat-users/200407.mbox/[EMAIL 
PROTECTED]

Please help me out if you have any ideas why this is happening.

regards
Christian Hvitved


The code in my filter looks like this:

            HttpServletRequest req = (HttpServletRequest)request;

           String headerValue = req.getHeader("Accept-Encoding");
           System.out.println("encoding: " + headerValue);

           Enumeration e = req.getHeaderNames();
           System.out.println("new request............");
           while (e.hasMoreElements()) {
               String header = (String) e.nextElement();
               System.out.println(header);
               System.out.println("Value: " + req.getHeader (header));

           }



---------------------------------------------------------------------
To start a new topic, e-mail: [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to