Method 6 for double-byte to single-byte
This method has the following characteristics:
- It is used for conversion between an input double-byte and an output single-byte CCSID.
- The valid encoding schemes for the input data are X'1200', X'2200', X'3200', X'5200', X'6200', X'7200', X'8200' and X'9200' (21) and for the output data are X'1100', X'2100', X'3100', X'4100', X'4105', X'4155' and X'6100'.
- It uses a TYPE 5 conversion table (see Figure 59) consisting of:
- A 256 byte subtable pointer record.
- A pool of 256 byte subtables.
- The method takes each input double-byte code point and separates it into a first and second byte.
- The first byte is used as an offset into the subtable pointer record.
- The value found at this location "points" to the appropriate record in the pool of subtables.
- The second byte is then used as an offset into the selected subtable record.
- The value found at this location is the single-byte output code point.
- In the example shown in Figure 59 the following takes place:
- The first byte of the input value X'00' is taken and used as the offset.
- At location X'00' in the subtable pointer record the value 03 is found.
- The method locates record 03 in the subtable pool and uses the second byte of the input value, X'41', as the offset.
- The value found at this location, X'C1', is the output single-byte value.
- The resultant output string will be half as long as the input string (each double-byte is converted to a single-byte).
- The content of the conversion table used governs the accuracy of the output data.
Figure 59. Method 6: DBCS to SBCS conversion table: