Getting the default charset.
Hi,
I need to get the default charset of the platform that I am using. I found a workaround by using an InputStreamReader with the required parameters and calling getEncoding() method. After this, I can user Charset.forName(...). On Windows platform, I get "Windows-1252". That's ok.
This solution works but, maybe someone knows a simpler way to get the same information. This is what I would like to know.
Thanks !
[441 byte] By [
Paulux1] at [2007-9-30 20:56:33]

I can't say how reliable, universal, or accurate this is, but System.getProperty("sun.jnu.encoding") gives me the value of Cp1252 in my machine, as expected.
Just been looking for exactly the same thing, so Google led me here. It also lead me to this:
http://java.sun.com/j2se/1.5.0/docs/api/java/nio/charset/Charset.html
In Java 1.5 ( but not in earlier versions), the Charset class contains a defaultCharset() static method, defined when the JVM starts up.
Hope this helps.