HP-UX 11i Release Notes (December 2000)

New and Changed Internationalization Features
Multibyte Support Extension and Unix98 Support (new)
Chapter 15308
Multibyte Support Extension and Unix98
Support (new)
A new set of multibyte APIs have been added to libc following the C99
specification (ISO/IEC 9899:1999), and the Unix98 specification.
These APIs extend the already existing multibyte and wide character
APIs in order to be able to:
perform input and output of wide character, or multibyte character, or
both
perform general wide string manipulation
provide extended capabilities for conversion between multibyte and
wide character sequences
Several new design concepts have been introduced:
Stream orientation
Restartable APIs and the conversion state
Stream Orientation
A stream can be either wide-character or byte-oriented. The orientation
of a stream is a concept based on an input/output model that assumes
that characters are handled as wide characters within an application
and stored as multibyte characters in files, and that all the
wide-character input/output functions begin executing with the stream
positioned at the boundary between two multibyte characters.
After a stream is associated with a file, but before any operations are
performed on the stream, the stream is without orientation. If a
wide-character input or output function is applied to a stream without
orientation, the stream becomes wide-oriented implicitly. Likewise, if a
byte input or output operation is applied to a stream without orientation,
the stream becomes byte-oriented implicitly. Once the stream becomes
oriented, the orientation is fixed and cannot be changed until the stream
is closed.