commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (IO-509) FileUtils.readFileToString: null not usable for default encoding
Date Tue, 07 Jun 2016 10:55:21 GMT

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

Sebb commented on IO-509:
-------------------------

i.e. 
If you want it to be portable, your code should always specify the charset and not rely on
the default being correct.

> FileUtils.readFileToString: null not usable for default encoding
> ----------------------------------------------------------------
>
>                 Key: IO-509
>                 URL: https://issues.apache.org/jira/browse/IO-509
>             Project: Commons IO
>          Issue Type: Bug
>          Components: Utilities
>    Affects Versions: 2.5
>            Reporter: Lars W
>
> Since 2.5 FileUtils.readFileToString(File) is deprecated. readFileToString(File, Charset)
should be used instead.
> The javadoc of readFileToString(File, Charset) says that, if the charset is null, the
platform default charset will be used.
> But I cannot use readFileToString(File, null) to get that behaviour, since there also
is readFileToString(File, String), so that readFileToString(File, null) is ambiguous.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message