commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henri Yandell" <flame...@gmail.com>
Subject Re: [io] Non-encoding versions of readFileToString etc
Date Fri, 08 Dec 2006 22:58:15 GMT
Suspected that would be suggested.

If it's the best I can get, then it's tempting despite the lengthy
nature; but given that java.lang.String's constructors have
default-encoding versions, as does String.getBytes(), it really
doesn't seem like the end of the world to allow the default to be
default.

The assumption that the app you've written is being given files that
match the platform you're on seems a very fair one to me. If it turns
out that's not the case, then much of the time my app isn't going to
be able to do anything about it anyway bar throw an exception to which
the fix will be 'fix the encoding of the file'.

Hen

On 12/8/06, Stephen Colebourne <scolebourne@btopenworld.com> wrote:
> I might let you get away with:
>
> public String readFileToStringUTF8(File f) {
>     return readFileToString(f, "UTF8");
> }
>
> or
>
> public String readFileToStringDefaultEncoding(File f) {
>     return readFileToString(f, null);
> }
>
> Stephen
>
>
> Henri Yandell wrote:
> > As it's highly irritating to use as a user, I wanted to confirm that
> > we were still -1 to having:
> >
> > public String readFileToString(File f) {
> >    return readFileToString(f, null);
> > }
> >
> > and the various other overlays?
> >
> > It sucks to keep adding null all over the place.
> >
> > Hen
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message