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 <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to