Guardian Procedure Calls Reference Manual (G06.25+)

Guardian Procedure Calls (M)
Guardian Procedure Calls Reference Manual522629-013
9-47
MBCS_TANDEM_TO_EXTERNAL_ Procedure
In the HP internal character sets, text bytes having the byte value x20 are used to
represent blank characters or spaces in both the 1-byte and the 2-byte character
sets. A 1-byte blank is represented by a single x20 byte. A 2-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 1-byte or 2-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 1-byte character (including a 1-byte blank) is
considered invalid and causes an error to be returned from this procedure. Two
consecutive 1-byte blanks in Kanji-only text is converted to a 2-byte blank in the
external format.
In mixed-text conversion operations, when blank bytes are encountered, the
conversion logic avoids changing the 1-byte/2-byte mode if possible. If compatible,
the external 1-byte/2-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 1-byte characters, are treated as 1-byte blanks.
One or more pairs of blanks following other 2-byte characters are treated as 2-byte
blanks. The following table summarizes the blank-handling logic followed in text
conversion operations from HP internal to other external formats.
Target Field Type
Internal Text
Number of Blanks Location in Field
External Text Number
and Type of Blanks
Kanji only 1 Any none (invalid)
Kanji only 2 Any one 2-byte
Mixed text 1 Any one 1-byte
Mixed text 2 Beginning two 1-byte
Mixed text 2 Following 1-byte two 1-byte
Mixed text 2 Following 2-byte one 2-byte
Note. The common representation for a 2-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 2-byte blank when the text
is converted to an external Kanji character set.