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

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,832
Latest member
GlennSmall

Latest Threads

Top