Multibyte String Handling

┌──────────────────────────────────────────────────────────────────────┐
│A double-byte character always needs to be handled as a two-byte unit.│
└──────────────────────────────────────────────────────────────────────┘

A double-byte character always needs to be handled by a two-byte unit. You should not bisect a double-byte character, and should not mistake the second byte of a double-byte character for a single-byte character, because the second byte of a double-byte character can take any hexadecimal value except 00H. If a double-byte character is bisected, you would not be able to tell whether it is a single-byte character or a part of a double-byte character. You need to take this rule into consideration when you program routines for truncation, substring, insertion, substitution and comparison.

Handling multibyte string is described in the IBM OS/2 DBCS Application Primer for DBCS OS/2 V2.1(DTCO-0011-2). Please refer to that document for the further description and examples.


[Back: Wide Character Testing and Conversion Functions]
[Next: Generating PM Windows]