Guardian Procedure Calls Reference Manual (G06.25+)

Guardian Procedure Calls (M)
Guardian Procedure Calls Reference Manual522629-013
9-52
MBCS_TRIMFRAGMENT_ Procedure
MBCS_TRIMFRAGMENT_ Procedure
Summary
Syntax for C Programmers
Syntax for TAL Programmers
Parameters
Related Programming Manual
Summary
The MBCS_TRIMFRAGMENT_ procedure detects and trims trailing multibyte
character fragments from text strings.
In conversational mode operations, a string read from a terminal might contain a partial
multibyte character at the end of the string; the result perhaps of a read operation of an
odd length. If the terminal operator attempts to enter a string of greater length than the
requested read count, the read operation will complete upon reaching the requested
read count. If the characters entered by the terminal operator were all 2-byte
characters, then the input byte which satisfies the read count becomes the first byte of
a 2-byte character. The second byte of the character is lost. Since multibyte
characters and 1-byte characters may be freely mixed in text strings, with a multibyte
character beginning at any byte location, a trailing fragment can occur at the end of
any conversational mode read operation. The multibyte character fragment is an
undesirable effect of the use of 1-byte I/O operations to handle multibyte characters.
Syntax for C Programmers
Syntax for TAL Programmers
#include <cextdecs(MBCS_TRIMFRAGMENT_)>
void MBCS_TRIMFRAGMENT_ ( char *bytestring
,short *bytecount
,[ short charset ]
,[ short *charinfo ] );
CALL MBCS_TRIMFRAGMENT_ ( bytestring ! i
,bytecount ! i,o
,[ charset ] ! i
,[ charinfo ] ); ! o