Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 332408

Summary: response header ContentType's value always set to "text/html;charset=iso-8859-1" when type is "text/html" in jetty 7.2.2
Product: [RT] Jetty Reporter: Paganini <zycandle>
Component: serverAssignee: Greg Wilkins <gregw>
Status: CLOSED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: jetty-inbox
Version: unspecified   
Target Milestone: 7.1.x   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Paganini CLA 2010-12-12 23:08:51 EST
Build Identifier: Eclipse Version: 3.6.0

I was using Jetty 6.1.24 for a java project, which runs well. But when I upgrade jetty to 7.2.2 recently, I encounter a problem: all characters (e.g. chinese characters) are displayed as "??" on pages.
I checked the source, and set request/response's characterEncoding to "UTF-8" in a spring's filter. But when response back to Jetty, it changes it to "text/html;charset=iso-8859-1", while in Jetty6.1.24, it was "text/html;charset=utf-8" which is correct.

I am wondering why this is changed to "iso-8859-1" by default. I searched the net, and find no valid solution.

OS: windows xp, windows 7
Jetty: 7.2.2
Eclipse: 3.6.0 (not related)

Thanks a lot!

Reproducible: Always
Comment 1 Greg Wilkins CLA 2010-12-13 04:03:56 EST
Can you tell me the exact sequence of calls and arguments to setContentType, setContentEncoding and getWriter?

thanks
Comment 2 Greg Wilkins CLA 2011-01-10 08:22:03 EST
I can't reproduce.

If you have more information, please reopen.
Comment 3 Paganini CLA 2011-01-11 09:55:49 EST
Hi all,
Sorry to not response this issue due to busy work.
I finally resolved this question after a very long debug, and find it's not a defect of jetty. It turns out that tiles encoding should be set explicitly.

Thanks for ur remind.

Pagnaini