null Charsets

R

Roedy Green

final InputStreamReader eisr = new InputStreamReader( bis,
( charset != null ? charset : Charset.defaultCharset() ) );


Sometimes a null Charset is treated as equivalent to the default
Charset and the code above would not be necessary. InputStreamReader
does not document if it can handle a null.

Is there some official overall policy on this?

In a related issue, it would make life easier if Charset.forName(
"default" ) gave you the platform default and you could treat it just
like any other encoding rather that having methods with and without an
Charset parameter.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,954
Messages
2,570,116
Members
46,704
Latest member
BernadineF

Latest Threads

Top