Examples

The same mixed date character string can be represented as character and hexadecimal data in different encoding schemes.

For the same mixed data character string, the following table shows character and hexadecimal representations of the character string in different encoding schemes. In EBCDIC, the shift-out and shift-in characters are needed to delineate the double-byte characters.
Table 1. Example of a character string in different encoding schemes
Data type and encoding scheme Character representation Hexadecimal representation (with spaces separating each character)
9 bytes in ASCII
Begin figure description. A string consists of a Kanji character, the Latin lowercase characters gen, another Kanji character, and the Latin lowercase characters ki. End figure description.
8CB3 67 65 6E 8B43 6B 69
13 bytes in EBCDIC
Begin figure description. A string is a shift-out, a Kanji character, a shift-in, the characters g e n, a shift-out, a Kanji character, a shift-in, and the characters k i. End figure description.
0E 4695 0F 87 85 95 0E 45B9 0F 92 89
11 bytes in Unicode UTF-8
Begin figure description. A string consists of a Kanji character, the Latin lowercase characters gen, another Kanji character, and the Latin lowercase characters ki. End figure description.
E58583 67 65 6E E6B097 6B 69

Because of the differences of the representation of mixed data strings in ASCII, EBCDIC, and Unicode, mixed data is not transparently portable. To minimize the effects of these differences, use varying-length strings in applications that require mixed data and operate on ASCII, EBCDIC, and Unicode data.