commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (Issue Comment Edited) (JIRA)" <j...@apache.org>
Subject [jira] [Issue Comment Edited] (IO-315) Replace all "String encoding" parameters with a value type
Date Mon, 26 Mar 2012 17:44:28 GMT

    [ https://issues.apache.org/jira/browse/IO-315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13238598#comment-13238598
] 

Sebb edited comment on IO-315 at 3/26/12 5:43 PM:
--------------------------------------------------

That makes more sense now, but I think it would be overkill to introduce a new interface here.

Using Charset would be better IMO.

Using Charset would convert the checked {{UnsupportedEncodingException}} into the unchecked
{{UnsupportedCharsetException}}.
This should simplify application code that does not already catch {{IOException}}, though
of course in Commons IO many methods throw IOE already.

AFAICT, parameters would need to be changed to use (e.g.) {{Charset.forName("UTF-8")}} instead
of {{"UTF-8"}} so user code would be slightly longer.
                
      was (Author: sebb@apache.org):
    That makes a more sense now, but I think it would be overkill to introduce a new interface
here.

Using Charset would be better IMO.

Using Charset would convert the checked {{UnsupportedEncodingException}} into the unchecked
{{UnsupportedCharsetException}}.
This should simplify application code that does not already catch {{IOException}}, though
of course in Commons IO many methods throw IOE already.

AFAICT, parameters would need to be changed to use (e.g.) {{Charset.forName("UTF-8")}} instead
of {{"UTF-8"}} so user code would be slightly longer.
                  
> 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

        

Mime
View raw message