.\" 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 FPUTU8 3 .Os .Sh NAME .Nm fputu8 .Nd utf-8 library function manual page .Sh SYNOPSIS .Fd #include .Ft int .Fn fputu8 "unsigned int c" "FILE *output" .Ft int .Fn utf8fputc "unsigned int c" "FILE *output" .Ft int .Fn utf8putc "unsigned int c" "FILE *output" .Ft int .Fn utf8putchar "unsigned int c" .Sh DESCRIPTION The .Fn fputu8 function of utf-8 library converts a UTC-4 (31-bit Unicode) integer to one or more bytes representing its UTF-8 value, and writes the result to a file. .Pp .Fn utf8fputc and .Fn utf8putc are macros which simply give .Fn fputu8 a name that may be more convenient to remember. They are defined in .Aq Pa utf-8.h . .Pp The .Fn fputu8 function and the macros take two arguments: .Fa c , the UTC-4 code, and .Fa input , which can be any open file. .Pp The .Fn utf8putchar macro sends output to stdout. .Sh RETURN VALUES .Fn fputu8 returns .Fa 0 on success; .Fa EOF if .Fa output is NULL or cannot be written to; .Fa 1 if .Fa c is not a valid UTC-4 code (i.e., its high bit is set). .Sh SEE ALSO .Xr libutf-8 3 , .Xr fgetu8 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 . .Sh AUTHORS This manual page was written by .An G. Adam Stanislav Aq adam@whizkidtech.net . .Sh BUGS None known.