Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2F6A89F3D for ; Mon, 26 Mar 2012 15:20:49 +0000 (UTC) Received: (qmail 69592 invoked by uid 500); 26 Mar 2012 15:20:48 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 69431 invoked by uid 500); 26 Mar 2012 15:20:48 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 69418 invoked by uid 99); 26 Mar 2012 15:20:48 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Mar 2012 15:20:48 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Mar 2012 15:20:47 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 7D4AC3470BC for ; Mon, 26 Mar 2012 15:20:27 +0000 (UTC) Date: Mon, 26 Mar 2012 15:20:27 +0000 (UTC) From: "Aaron Digulla (Commented) (JIRA)" To: issues@commons.apache.org Message-ID: <1395044365.17697.1332775227523.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <2100985287.16710.1332754526944.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (IO-315) Replace all "String encoding" parameters with a value type MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/IO-315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13238469#comment-13238469 ] Aaron Digulla commented on IO-315: ---------------------------------- My point is that everyone litters their code with string constants. String constants are bad for various reasons and APIs should not endorse them. In my own code, I use an interface so everyone can add more encodings if they need that but afterwards, I always know what is an encoding and what is text data (so no mixups like {{FileUtils.write("UTF-8", "Hello, world")}}). But I agree that commons IO is probably the wrong place to add them. Moving to commons-lang (which also contains code that handles the exception). > Replace all "String encoding" parameters with a value type > ---------------------------------------------------------- > > Key: IO-315 > URL: https://issues.apache.org/jira/browse/IO-315 > Project: Commons IO > Issue Type: New Feature > Components: Streams/Writers > Affects Versions: 2.1 > Reporter: Aaron Digulla > > Please create an interface "Encoding" plus a set of useful defaults (UTF_8, ISO_LATIN_1, CP_1250 and CP_1252). > Use this interface in all places where "String encoding" is used now. This would make the API more reliable, improve code reuse and reduce futile catch blocks for {{UnsupportedEncodingException}}. -- 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