Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 1831 invoked from network); 17 Jun 2010 15:33:09 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 17 Jun 2010 15:33:09 -0000 Received: (qmail 34224 invoked by uid 500); 17 Jun 2010 15:33:05 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 34088 invoked by uid 500); 17 Jun 2010 15:33:04 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 34079 invoked by uid 99); 17 Jun 2010 15:33:04 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Jun 2010 15:33:04 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of knst.kolinko@gmail.com designates 209.85.161.45 as permitted sender) Received: from [209.85.161.45] (HELO mail-fx0-f45.google.com) (209.85.161.45) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Jun 2010 15:32:57 +0000 Received: by fxm9 with SMTP id 9so32634fxm.18 for ; Thu, 17 Jun 2010 08:32:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=bgYj4UOwcgRQ5iAGgdtECwZ2vhWxACeN/gK65nBe504=; b=NKkvFQ+xf7wFopic2SfdkwrqDO3Ku0H0HoTSRMbRHm/xuPrKxiPTVrtb2L1HOl5MYe JDYRLSu+aCRCnsnSlg+ifdmdjLbdlZjeNdo+TEF4BLtRJsgtc5qxXuANq9JPWksjyB9i Ojb4A0vQhJQ/99n5et4dHE8J6ADGHA8f+bgU0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=xh4x9XWPdCerVOZFGGGzKXMZTQ73ltXfK++3pV9DSO4JQXy3WamtOT1C2yq4mZWV4g NSNETOhW/hcRN7Rfyq+SAt8Jh5qIv+ZohGEh9lCQ/aNes11G6eMGPggzAfFtdwuwPI8k NLi1vjb6wZ40A3CX90qmmHsYw6/PTgia7t/KY= MIME-Version: 1.0 Received: by 10.102.14.25 with SMTP id 25mr3536871mun.30.1276788756883; Thu, 17 Jun 2010 08:32:36 -0700 (PDT) Received: by 10.102.83.2 with HTTP; Thu, 17 Jun 2010 08:32:36 -0700 (PDT) In-Reply-To: References: Date: Thu, 17 Jun 2010 19:32:36 +0400 Message-ID: Subject: Re: DefaultServlet and default character encoding From: Konstantin Kolinko To: Tomcat Users List Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org 2010/6/17 Felix Schumacher : > For the moment I have written a filter, which sets a default encoding, as > soon as Response.setContentType(String type) is called and > type.startsWith("text/"). That works for the moment, but I would prefer the > solution described in above thread. I know that setting charset in a mime-mapping works, e.g.: htm text/html;charset=iso-8859-1 html text/html;charset=iso-8859-1 Note, that it would be better if the mime type set by a HTTP header and the one provided by HTML tag match strictly (case sensitively). Otherwise some browsers will start guessing. IIRC, the HTML spec says that the HTTP header takes precedence, but not all browsers follow it strictly. Also there is AddDefaultCharsetFilter in Tomcat 7. It is similar to what you are doing, see its JavaDoc and source code. > apache httpd thinks it would be better to append a > charset to the response I wonder, if there is a way to improve your Apache HTTPD configuration. Best regards, Konstantin Kolinko --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org