[ jetty-Bugs-1251170 ] Character Encoding

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[ jetty-Bugs-1251170 ] Character Encoding

Bugs item #1251170, was opened at 2005-08-03 17:09
Message generated for change (Settings changed) made by gregwilkins
You can respond by visiting:

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: HTTP protocol
Group: None
>Status: Closed
Resolution: Fixed
Priority: 5
Submitted By: Lars Borup Jensen (lborupj)
Assigned to: Greg Wilkins (gregwilkins)
Summary: Character Encoding

Initial Comment:
I've come across a scenario where the HttpMessage seems
to wrongly parse the encoding part of the Content-Type
When using Microsoft .NET C# to send a SOAP request to
a servlet deployed in Jetty 5.1.4, the .NET framework
adds yet another parameter to the Content-Type header
which then seems to confuse the HttpMessage parsing of

This is the Content-Type as send by .NET

Content-Type: application/soap+xml; charset=utf-8;

The HTTP/1.1 spec seem to allow multiple parameters (AFAIK)

This snippet is from the HttpMessage.java file, where I
think the problem may lay.

               // Look for charset
                int i1=contentType.indexOf("charset=",i0);
                if (i1>=0)
                    int i2 = contentType.indexOf(' ',i1);
                    _characterEncoding = (0<i2)
                        ? contentType.substring(i1,i2)
                        : contentType.substring(i1);
                    _characterEncoding =

As you can see, the characterEncoding will be e.g.
"utf-8;" with the semicolon at the end, which then
produces an exception as the VM cannot recognize such
an encoding (when creating a reader using
request.getReader()),"utf-8" would be correct I think..

/Lars Borup Jensen
Email: lars.borup (at) email.dk


Comment By: Greg Wilkins (gregwilkins)
Date: 2005-08-24 08:51

Logged In: YES

Fixed in CVS thanks.


You can respond by visiting:

This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
jetty-discuss mailing list
[hidden email]