Return-Path: Delivered-To: apmail-jakarta-tomcat-dev-archive@www.apache.org Received: (qmail 89286 invoked from network); 26 Jul 2004 11:34:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 26 Jul 2004 11:34:43 -0000 Received: (qmail 30352 invoked by uid 500); 26 Jul 2004 11:34:34 -0000 Delivered-To: apmail-jakarta-tomcat-dev-archive@jakarta.apache.org Received: (qmail 30314 invoked by uid 500); 26 Jul 2004 11:34:34 -0000 Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Developers List" Reply-To: "Tomcat Developers List" Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 30298 invoked by uid 99); 26 Jul 2004 11:34:34 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [212.34.160.79] (HELO mx.odn.de) (212.34.160.79) by apache.org (qpsmtpd/0.27.1) with ESMTP; Mon, 26 Jul 2004 04:34:31 -0700 Received: from linux3 (docware.odn.net [194.231.109.131]) by mx.odn.de (8.12.10/8.12.9) with ESMTP id i6QBYOkg005265 for ; Mon, 26 Jul 2004 13:34:25 +0200 Received: from pc2.fuerth.docware.de ([10.10.10.103] helo=pc2) by linux3 with smtp (Exim 3.36 #1 (Debian)) id 1Bp3jq-0004c9-00; Mon, 26 Jul 2004 13:33:50 +0200 From: =?iso-8859-1?Q?Michael_S=FCdkamp?= To: Cc: "'Docware, Peter, Christian'" Subject: default charset for text/* Date: Mon, 26 Jul 2004 13:34:21 +0200 Message-ID: <007801c47304$7fb77750$670a0a0a@Fuerth.docware.de> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook CWS, Build 9.0.2416 (9.0.2911.0) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 Importance: Normal X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hello, In our web-app that runs with Tomcat 4.1.29 we set the content-type to = "text/xml" in a servlet that serves an XML file. The XML encoding = normally is UTF-8. We observed that special characters show up wrong in = the browser. Packet sniffing revealed that Tomcat changed the = content-type to "text/xml;charset=3DISO-8859-1" which was not the case = with earlier Tomcat versions. I looked up the bug database and the mailing list for this behaviour and = read that Tomcat behaves like this for alle "text/*" content types where = the charset is mising. To fix this I can change the mime-type-definition in web.xml to = "text/xml;charset=3DUTF-8" or add this in my servlet. But If my servlet = has to serve ISO-8859-1 XML files that would be also wrong. Should I = parse the resource prior to serving it in order to determine the = encoding? I cannot find the strong requirement to add the default charset in the = HTTP spec. I read a discussion in the list that the JSP spec requires it = - but also for a servlet? I think the charset is added by the Coyote = connector so from the connector's point of view servlets and = JSP-servlets are the same. Doesn't it make sense to omit the default charset for XML files because = XML files normally should carry their encoding in the header? Then the = browser could get the encoding from there as it was done with earlier = Tomcat versions. What is your opionion? Best Regards Michael --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org