Guardian Procedure Calls Reference Manual
translation, specify the source-length, maximum-length, and external-form
parameters, and the other formal parameters can be omitted.
• In the HP internal character sets, text bytes having the byte value x20 are used to represent
blank characters or spaces in both the one-byte and the two-byte character sets. A one-byte
blank is represented by a single x20 byte. A two-byte blank is represented by two consecutive
x20 bytes. When converting text from the HP internal format to an external format, some
ambiguity might be introduced in choosing the one-byte or two-byte mode for the external
form of two or more consecutive x20 bytes found in the internal text string.
For conversion of Kanji-only text, any one-byte character (including a one-byte blank) is
considered invalid and causes an error to be returned from this procedure. Two consecutive
one-byte blanks in Kanji-only text is converted to a two-byte blank in the external format.
In mixed-text conversion operations, when blank bytes are encountered, the conversion logic
avoids changing the one-byte/two-byte mode if possible. If compatible, the external
one-byte/two-byte mode of the blanks is assumed to be the same as that of the context before
the location of the blank bytes. One or more blanks found at the start of a field, or following
other one-byte characters, are treated as one-byte blanks. One or more pairs of blanks following
other two-byte characters are treated as two-byte blanks. This table summarizes the
blank-handling logic followed in text conversion operations from HP internal to other external
formats.
Type External Text
Number and Type of
Blanks
Location in FieldInternal Text Number of
Blanks
Target Field
none (invalid)Any1Kanji only
one two-byteAny2Kanji only
one one-byteAny1Mixed text
two one-byteBeginning2Mixed text
two one-byteFollowing one-byte2Mixed text
one two-byteFollowing two-byte2Mixed text
NOTE: The common representation for a two-byte blank character in the Shift-JIS character
code is x8140, While HP subsystem software might not recognize and treat this character
code as a blank, if it is present in an internal text string, it will be mapped to a two-byte blank
when the text is converted to an external Kanji character set.
• When MBCS_TANDEM_TO_EXTERNAL_ finds invalid or nondisplayable two-byte characters
in the source string, it maps them to reserved values as follows:
Nondisplayable Pairs Map toInvalid Pairs Map toDestination Format
%HFEFD%HFEFEIBM
%HA0FD%HA0FEFujitsu
%H2223%H2222JIS
• The definition of nondisplayable and invalid characters varies with the target mapping format.
Mapping between HP and IBM formats is done with mapping tables. There are many HP
two-byte character codes that do not have defined fonts. These character codes do not have
defined character code targets in the IBM format, and thus they are mapped to the
nondisplayable character code.
Mapping between HP formats and Fujitsu or JIS formats is done by algorithm. The HP internal
character set is larger than the supported Fujitsu or JIS character set. Valid two-byte character
MBCS_TANDEM_TO_EXTERNAL_ Procedure 821