// how to determine the default encoding
import java.io.OutputStreamWriter;
import java.nio.charset.Charset;

// in JDK 1.4, defaultEncodingName will typically be "Cp1252"
// In an Applet, this requires signing for privilege.
String defaultEncodingName = System.getProperty( "file.encoding" );

// in JDK 1.5+, will typically be "windows-1252"
// First, get the Charset/encoding then convert to String.
String defaultEncodingName = Charset.defaultCharset().name();

// I'm told this circumlocution has the nice property you can even use
// it in an unsigned Applet.
String defaultEncodingName = new OutputStreamWriter( System.out ).getEncoding();