Method 5 for single-byte to double-byte
This method has the following characteristics:
- It is used for conversion between an input single-byte and an output double-byte CCSID.
- The valid encoding schemes for the input data are X'1100', X'2100', X'3100', X'4100', x'4105', X'4155'and X'6100', and for the output data are X'1200', X'2200', X'3200', X'5200', X'6200', X'7200', X'8200' and X'9200' (21).
- It uses a TYPE 4 conversion table (see Figure 58) consisting of one 512 byte record (this allows for 256 double-byte output values).
- The possible input, single-byte code point values are in the range X'00' through X'FF'.
- The input code point is used as an offset into the conversion table. The 2-byte entry beginning at this location is the actual output double-byte code point.
- The following steps are taken in order to convert a single-byte X'40' to a UCS-2 (double-byte) value, as shown in Figure 58:
- The input value of X'40', is used as an index into the conversion table.
- The X'40'th entry is found (remembering that each entry in the conversion table is two bytes long).
- The two bytes found at this location comprise the output double-byte code point value.
- The resultant output string will be twice as long as the input string (each single-byte is converted to a double-byte).
- The content of the conversion table used governs the accuracy of the output data.
Figure 58. Method 5: SBCS to UCS Conversion Table
SBCS input X'40' 00 128 129 00 40 40th entry, offset into the conversion table, Conversion table consists of 256 doublt-byte code points X'40' USC output
Back to top
Return to Appendix B