Internal code for {@link java.io.InputStreamReader#InputStreamReader(InputStream, String)}.

Adding a character encoding to J2ME.

To add a supported character encoding for J2ME add a class named <internal encoding name>_Reader to the com.sun.cldc.i18n package.

To find out the prefered name for a character encoding see the IANA Charset Registry.

The characters of a standard character encoding name that are specified by IANA and accepted by J2SE are "0-9", "a-z", "A-Z", "_", "-", ":". Also encoding names are not case sensitive. This is a problem for Java class names, so when creating an internal encoding name for a reader class name, convert lower case characters to upper case and convert "-" and ":" to "_". For encodings that begin with a digit, use any non-conflicting name and add an internal encoding name system property to map to the internal name as outlined below.

To allow for multiple names for an character encoding and to allow encoding names that cannot be legal Java class names, system properties can be added to map an external encoding names to an internal encoding names. To map a particular encoding, first normalize the name by converting lower case characters to upper case and converting "-" and ":" to "_". Second create a system property name by appending "_InternalEncodingName" to the normalized name. Third specify the internal encoding name as the value of the property.

For example, say there is a reader for the internal encoding name SJIS, (class name: com.sun.cldc.i18n.SJIS_Reader), but you want to support the standard IANA encoding name of Shift_JIS also, you would add the following system property.

SHIFT_JIS_InternalEncodingName: SJIS