.\" The Regents of the University of California. All rights reserved.
.\" This code is derived from software contributed to Berkeley by
.\" Paul Borman at Krystal Technologies.
.\" %sccs.include.redist.roff%
.\" @(#)rune.3 8.1 (Berkeley) %G%
.Fn setrunelocale "char *locale"
.Fn setinvalidrune "rune_t rune"
.Fn sgetrune "const char *string" "size_t n" "char const **result"
.Fn sputrune "rune_t rune" "char *string" "size_t n" "char **result"
.Fn fgetrune "FILE *stream"
.Fn fungetrune "rune_t rune" "FILE *stream"
.Fn fputrune "rune_t rune" "FILE *stream"
controls the type of encoding used to represent runes as multibyte strings
as well as the properties of the runes as defined in
argument indicates the locale which to load.
If the locale is successfully loaded,
is returned, otherwise an errno value is returned to indicate the
function sets the value of the global value
function tries to read a single multibyte character from
is successful, the rune is returned.
will point to the first byte which was not converted in
do not describe a full multibyte character,
If there is an encoding error at the start of
will point to the second character of
as a multibyte string and store it at
will be set to point to the first byte in string following the new
is the number of bytes that would be needed to store the multibyte value.
If the multibyte character would consist of more than
will return the number of bytes which would be needed to store
as a multibyte character.
function operates the same as
with the exception that it attempts to read enough bytes from
to decode a single rune. It returns either
on an encoding error, or the rune decoded if all went well.
function function pushes the multibyte encoding, as provided by
function writes the multibyte encoding of
function returns one of the following values:
.Fa setrunelocale was successful.
The locale could not be found.
The file found was not a valid file.
The encoding indicated by the locale was unknown.
function either returns the rune read or
function returns the number of bytes needed to store
.Bl -tag -width /usr/share/locale/locale/LC_CTYPE -compact
.It Pa $PATH_LOCALE/\fIlocale\fP/LC_CTYPE
.It Pa /usr/share/locale/\fIlocale\fP/LC_CTYPE
binary LC_CTYPE file for the locale \fIlocale\fP.
was chosen to accent the purposeful choice of not basing the
primitives, which were, shall we say, less aesthetic.
These functions first appeared in
function and the other non-ANSI rune functions were inspired by
.Nm Plan 9 from Bell Labs
as a much more sane alternative to the ANSI multibyte and
.\"They were conceived at the San Diego 1993 Summer USENIX conference by
.\"Paul Borman of Krystal Technologies, Keith Bostic of CSRG and Andrew Hume
All of the ANSI multibyte and wide character
support functions are built using the rune functions.