Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 8780 invoked from network); 8 Feb 2007 18:40:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Feb 2007 18:40:30 -0000 Received: (qmail 33503 invoked by uid 500); 8 Feb 2007 18:40:35 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 33438 invoked by uid 500); 8 Feb 2007 18:40:35 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 33427 invoked by uid 99); 8 Feb 2007 18:40:34 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Feb 2007 10:40:34 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Feb 2007 10:40:27 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 3446042968C for ; Thu, 8 Feb 2007 10:40:07 -0800 (PST) Message-ID: <31161756.1170960007211.JavaMail.jira@brutus> Date: Thu, 8 Feb 2007 10:40:07 -0800 (PST) From: "Ben Speakmon (JIRA)" To: commons-dev@jakarta.apache.org Subject: [jira] Updated: (EMAIL-1) [email] setCharset() in Email does not set the charset for the message content MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/EMAIL-1?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ben Speakmon updated EMAIL-1: ----------------------------- Attachment: email-1.patch Here's a patch to address this. It includes a fix and tests for three scenarios: 1) setContent() with a text content type *without* any specific charset. If a charset has been previously set, it is automatically applied to the content type. (This fixes the actual issue.) 2) setContent() with a text content type *with* a specific charset. The content type charset will override any previously set charset and will change the Email's default charset to itself. (This is current behavior.) 3) setContent() with a non-text content type. Any charset already set in the message will be ignored, since we don't want to declare encodings for binary types. Besides, they'll either come with their own encodings or will be left to the underlying platform. (This is also current behavior, but this ensures that the fix for #1 doesn't inadvertently break other types of content. > [email] setCharset() in Email does not set the charset for the message content > ------------------------------------------------------------------------------ > > Key: EMAIL-1 > URL: https://issues.apache.org/jira/browse/EMAIL-1 > Project: Commons Email > Issue Type: Bug > Affects Versions: 1.0 > Environment: Operating System: other > Platform: Other > Reporter: James Mc Millan > Attachments: email-1.patch > > > Hello > More accurately, the charset is not used in buildMimeMessage() as it is not part > of the contentType used when calling message.setContent(). Since > setContentType() updates the charset, I think it makes for setCharset() to > update the contentType? > James -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org