>>how can i get the default encoding value of a jvm or a system?
>
> see http://mindprod.com/jgloss/encoding.html
> hint: it is not DEFAULT !!!
This little trick should tell you the JVM-OS default encoding. More
transparent implementation would use a os-generated temporary file and
then delete it. Most likely utility class with a static value would
create a temp file on first method invocation and then reuse that value.
I dont know whether we could use FileReader to achieve the same encoding
value.
private String getDefaultCharSet() throws IOException {
FileWriter filewriter = new FileWriter("out");
String encname = filewriter.getEncoding();
filewriter.close();
return encname;
}