character sets

S

Steve Horsley

Robert said:
How can I determine what the default character set is in my JVM?
_Robert
How about:
String default = new OutputStreamWriter(new ByteArrayOutputStream()).getEncoding();


Steve
 
R

Roland

How can I determine what the default character set is in my JVM?
_Robert

System.getProperty("file.encoding");

--
Regards,

Roland de Ruiter
___ ___
/__/ w_/ /__/
/ \ /_/ / \
 
M

Mark Thornton

Roland said:
System.getProperty("file.encoding");

Although as that property isn't documented, it might not exist on some
systems. As an alternative you could create an instance of
InputStreamReader, using the constructor which doesn't specify the
encoding, and then call the getEncoding() method. The same approach
could also be used with OutputStreamWriter.

Mark Thornton
 

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,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top