HP-UX 11i Release Notes (December 2000)
New and Changed Internationalization Features
Multibyte Support Extension and Unix98 Support (new)
Chapter 15 309
Restartable APIs and the Conversion State
A new set of APIs have been introduced to facilitate the conversion
between multibyte character representations to wide character
representations. These APIs use a new object type, mbstate_t, that can
hold the conversion state information necessary to convert between
sequences of multibyte characters and wide characters. The conversion
state determines the behavior of a conversion between multibyte and
wide-character encodings. For conversion from multibyte characters to
wide characters, the conversion state stores information, such as the
position, within the current multibyte character (as a sequence of
characters or a wide character accumulator). For conversions in either
direction, the conversion state stores the current shift state, if any, and
possibly, the encoding rule.
As these APIs store the partial character information, a multibyte
sequence can be processed one byte at a time, and the processing can be
interrupted and continued (i.e., restarted) at some other point in time, so
the new multibyte/wide-conversion utilities are thus made restartable by
using the information in the mbstate_t object.
How to Get MSE/Unix98 Behavior
In order to get MSE/Unix98 behavior, the programs have to be compiled
with the -D_XOPEN_SOURCE=500 macro definition and the variable has
to be defined in the environment.
Under the Korn, Bourne, and POSIX shells, this is done with:
UNIX_STD=98
export UNIX_STD
Under the C shell this is done using
setenv UNIX_STD 98
A cc compiler equal to HP92453-01 A.11.01.20 HP C Compiler or newer
is required to get this functionality.
Below is a summary list of new and modified APIs. For further details,
please refer to the corresponding manpages.
New Interfaces
The following APIs are newly added to libc and will not affect existing
code: