Positional entry considerations for printer files that use UTF-16 data

These are Unicode considerations for length, data type, and decimal positions for printer files.

Positions that are not mentioned have no special considerations for UTF-16. UTF-16 also implies UCS-2.

Length (positions 30 through 34)

Specify the length of the field in these positions. The length of a field containing UTF-16 data can range from 1 through 16 383 code units. When determining the program length of a field containing UTF-16 data, consider the following conditions:

  • Each UTF-16 code unit is 2 bytes long.
  • Specify the program length of the field as the number of UTF-16 code units (count surrogate pairs as two code units). For example, a field containing 3 UTF-16 code units has 6 bytes of data.
  • The field's default print length is equal to the field's program length, or 2 times the number of UTF-16 code units.
  • After converting between UTF-16 data and EBCDIC, the resulting data might be equal to, longer than or shorter than the original length data. This depends on the target CCSID specified on the CHRID parameter of the printer file. For example, 1 UTF-16 code unit consists of 2 bytes of data. That code unit might convert to 1 SBCS character composed of 1 byte of data, 1 graphic-DBCS character composed of 2 bytes of data, or 1 bracketed DBCS character composed of 4 bytes of data.
  • You can use the alternate-field-length parm on the CCSID keyword to specify the field's print length separately from the program length.

Data type (position 35)

The only valid data type for UTF-16 data is the G data type.

G (Graphic)
Type G in combination with the CCSID keyword to specify that this field contains UTF-16 data.

Normally, the field contains graphic-DBCS data if you specified G. In combination with the CCSID keyword, however, the field now contains UTF-16 data.

Decimal positions (positions 36 and 37)

Leave these positions blank when using UTF-16 data.