Return-Path: X-Original-To: apmail-hc-dev-archive@www.apache.org Delivered-To: apmail-hc-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3A8BD99D4 for ; Wed, 6 Jun 2012 18:47:24 +0000 (UTC) Received: (qmail 5725 invoked by uid 500); 6 Jun 2012 18:47:23 -0000 Delivered-To: apmail-hc-dev-archive@hc.apache.org Received: (qmail 5487 invoked by uid 500); 6 Jun 2012 18:47:23 -0000 Mailing-List: contact dev-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpComponents Project" Delivered-To: mailing list dev@hc.apache.org Received: (qmail 5223 invoked by uid 99); 6 Jun 2012 18:47:23 -0000 Received: from issues-vm.apache.org (HELO issues-vm) (140.211.11.160) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Jun 2012 18:47:23 +0000 Received: from isssues-vm.apache.org (localhost [127.0.0.1]) by issues-vm (Postfix) with ESMTP id 20EF81402B8 for ; Wed, 6 Jun 2012 18:47:23 +0000 (UTC) Date: Wed, 6 Jun 2012 18:47:22 +0000 (UTC) From: "Christopher G. Stach II (JIRA)" To: dev@hc.apache.org Message-ID: <1928388735.44467.1339008443137.JavaMail.jiratomcat@issues-vm> Subject: [jira] [Created] (HTTPCORE-299) o.a.h.entity.ContentType should rely on Charset.name() instead of Charset.toString() for building header MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Christopher G. Stach II created HTTPCORE-299: ------------------------------------------------ Summary: o.a.h.entity.ContentType should rely on Charset.name() instead of Charset.toString() for building header Key: HTTPCORE-299 URL: https://issues.apache.org/jira/browse/HTTPCORE-299 Project: HttpComponents HttpCore Issue Type: Bug Components: HttpCore Affects Versions: 4.2 Reporter: Christopher G. Stach II Other than relying upon toString for functional code being a bad idea, the java.nio.charset.Charset API contains the name() method for retrieving the canonical name (ContentType.java:118). At least on Android, Charset.toString() returns the class name and the canonical name. This makes the new API from HTTPCORE-297 somewhat broken, as you'll still need to rely on the recently deprecated StringEntity API, like the following, in order to get a header that works: new StringEntity(str, contentType.getMimeType(), contentType.getCharset().name()) -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org For additional commands, e-mail: dev-help@hc.apache.org