[
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