HP 9000 User Manual page 152

Computers
Hide thumbs Also See for 9000:
Table of Contents

Advertisement

Data Integrity
Data integrity means that in processing codeset data, the data must not be
corrupted. For single-byte codesets, the 8th bit must be preserved; it must
not be stripped or used by the program. For multi-byte codesets, single-byte
characters must be correctly distinguished from multi-byte characters.
HP's multi-byte codesets utilize an encoding scheme in which the single-byte
character codes for ASCII can be intermixed with the two-byte character codes
used to represent ideograms. In these codesets, it is possible for the second
byte of a two-byte character to have the same value as an ASCII character.
For an arbitrary byte, it is not possible to know if the byte is a single-byte
character or the second byte of a multi-byte character. This is the "byte
redefinition" problem in which the second byte of a multi-byte character may
be incorrectly interpreted as a one-byte character.
Even for those encoding schemes such as EVC that avoid much of the
byte-redefinition problem, an efficient way of dividing a byte stream along
character boundaries is needed.
To aid in processing multi-byte codesets and avoid the byte redefinition
problem, there are a number of routines available to the programmer. These
routines are described in the sections that follow.
Programming with Multi-byte Characters
For dealing with HP's multi-byte codesets, see nLtools_16(3C) in the HP-UX
Reference which describes a set of byte-status macros:
FIRSTof2, SECof2,
BYTE_STATUS,
and
C_COLWIDTH.
The syntax for the routines is:
#include <nl_type.h>
int c, laststatus;
FIRSTof2(c);
SECof2(c);
BYTE_STATUS(c,laststatus);
C_COLWIDTH(c);
Special Topics for HP's 16-bit Interfaces A-5
A

Advertisement

Table of Contents
loading

Table of Contents