MultiByte
structureThe optional MultiByte structure provides support for multibyte encoded strings through functions that convert multibyte strings to and from wide strings and wide characters.
Although the interface supports stateful multibyte encodings, an implementation may support only stateless multibyte encodings. Such an implementation may raise Invalid when any of the functions that take a state argument are called in a locale that uses a stateful encoding.
signature MULTIBYTE
structure MultiByte
: MULTIBYTE
type state
exception Invalid
val initial : state
val mbStringToWide : Word8Vector.vector -> WideString.string
val wideStringToMB : WideString.string -> Word8Vector.vector
val mbCharSize : (state * substring) -> (state * substring * int)
val mbCharToWide : (state * substring) -> (state * substring * WideString.char)
val mbSubstringToWide : (state * substring) -> (state * WideString.string)
val wideCharToMB : (state * WideString.Char.char) -> (state * string)
val wideSubstringToMB : (state * WideSubstring.substring) -> (state * string)
val wideCharToChar : WideString.char -> char option
val collate : (WideSubstring.substring * WideSubstring.substring) -> order
type state
exception Invalid
initial
mbStringToWide s
mbstowcs
.
wideStringToMB s
wcstombs
.
mbCharSize (st, s)
mbrlen
.
mbCharToWide (st, s)
mbrtowc
.
mbSubstringToWide (st, s)
mbsrtowcs
.
wideCharToMB (st, wc)
wcrtomb
.
wideSubstringToMB (st, ws)
wcsrtombs
.
wideCharToChar wc
SOME c
where c is a single byte character corresponding to wc, if such a mapping exists. Returns NONE if the wide character wc cannot be converted. This function corresponds to the ISO C function wctob
.
collate (s, t)
strcoll
.
WideChar, WideString, WideSubstring, Locale
Last Modified January 21, 1997
Comments to John Reppy.
Copyright © 1997 Bell Labs, Lucent Technologies