Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Code sets

In ASCII-based operating systems, the partial identity between ASCII and Unicode means that it is not always necessary to distinguish between text and binary input/output. However, in BS2000 (and other non-ASCII-based operating systems, such as OS/390), this distinction is extremely important. If this is not taken into consideration in Java programs, not only will they not be portable, but they will have to be modified if they are to function correctly on BS2000.

Java works internally in Unicode. For communication with the outside world Java can use any code. For the input/output of text data, the new classes
InputStreamReader and OutputStreamWriter, which perform the appropriate code conversions, have been introduced in JDK 1.1. The standard code conversion which is used here is determined by the value of the system property file.encoding. By default this is set to OSD_EBCDIC_DF04_1. When Java is called, this setting can be changed either globally via -Dfile.encoding=XXX or else locally through specification of an appropriate code set during instantiation of the classes InputStreamReader and OutputStreamWriter.

Supported code sets

The following code sets are additionally supported in BS2000 and accordingly are not available in other Java implementations:

OSD_EBCDIC_DF04_1

Default code set in BS2000. It is the same as the EBCDIC.DF.04-1 character set, except that the EBCDIC characters x'15' and x'25' are swapped, so that x'15' is interpreted as the character for newline. This is in keeping with current practice in POSIX and in C programming in BS2000.

This character set is compatible with the ISO 8859-1 character set, the default character set used in Unix systems. “Compatible” here means that it contains the same character set and can therefore be mapped 1:1, it is just that encoding is different.

OSD_EBCDIC_DF03_IRV

EBCDIC.DF.03.IRV (international reference version) character set, in which, once again, x'15' is the character for newline.

OSD_EBCDIC_DF04_15

This is the same as the EBCDIC.DF.04_15 character set, except that the EBCDIC characters x'15' and x'25' are swapped, so that x'15' is interpreted as the character for newline. This is in keeping with current practice in POSIX and in C programming in BS2000.
This character set is fully compatible with the ISO 8859-15 character set. “Compatible” here means that it contains the same character set and can therefore be mapped 1:1, it is just that encoding is different.

Specification of the code set

The commands javac, javadoc, appletviewer/ and native2ascii support the -encoding option, which allows you to specify the character set for the files to be accessed by the command.