.\" Copyright (c) 1999 G. Adam Stanislav .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" libutf-8 v.1 .\" .Dd April 1, 1999 .Dt FGETU8 3 .Os .Sh NAME .Nm fgetu8 .Nd utf-8 library function manual page .Sh SYNOPSIS .Fd #include .Ft unsigned int .Fn fgetu8 "FILE *input" .Ft unsigned int .Fn utf8fgetc "FILE *input" .Ft unsigned int .Fn utf8getc "FILE *input" .Ft unsigned int .Fn utf8getchar .Sh DESCRIPTION The .Fn fgetu8 function of utf-8 library reads one or more bytes from a UTF-8 formatted text file, and converts them to single UTC-4 (Unicode) value. .Pp .Fn utf8fgetc and .Fn utfgetc are macros which simply give .Fn fgetu8 a name that may be more convenient to remember. They are defined in .Aq Pa utf-8.h . .Pp The .Fn fgetu8 function and the macros take one argument: .Fa input , which can be any open file. .Pp The .Fn utf8getchar macro reads input from stdin. .Sh RETURN VALUES If .Fa input is NULL, or if a premature end-of-file condition occurs, .Fn fgetu8 returns .Fa EOF . If .Fa input contains valid UTF-8 codes, .Fn fgetu8 returns the converted UTC-4 value. Otherwise, it returns .Fa UTF8INVALID , defined in .Aq Pa utf-8.h . .Sh SEE ALSO .Xr libutf-8 3 , .Xr fputu8 3 , .Xr sgetu8 3 , .Xr sputu8 3 .Rs .%A F. Yergeau .%T UTF-8, a transformation format of Unicode and ISO 10646 .%O RFC2044 .Re .Rs .%A D. Goldsmith, M. Davis .%T Using Unicode with MIME .%O RFC1641 .Re .Sh STANDARDS ISO 10646-1: 1993 (``Unicode''), RFC 2044: 1996 (``UTF-8''), .St -ansiC . .Sh DIAGNOSTICS You should always check the .Sx RETURN VALUES against .Fa EOF and .Fa UTF8INVALID . .Sh AUTHORS This manual page was written by .An G. Adam Stanislav Aq adam@whizkidtech.net . .Sh BUGS None known.