-.\" $OpenBSD: mbtowc.3,v 1.7 2023/11/11 01:28:41 schwarze Exp $
+.\" $OpenBSD: mbtowc.3,v 1.8 2023/11/11 01:38:23 schwarze Exp $
.\" $NetBSD: mbtowc.3,v 1.5 2003/09/08 17:54:31 wiz Exp $
.\"
.\" Copyright (c) 2016, 2023 Ingo Schwarze <schwarze@openbsd.org>
.Dd $Mdocdate: November 11 2023 $
.Dt MBTOWC 3
.Os
-.\" ----------------------------------------------------------------------
.Sh NAME
.Nm mbtowc
.Nd converts a multibyte character to a wide character
-.\" ----------------------------------------------------------------------
.Sh SYNOPSIS
.In stdlib.h
.Ft int
.Fn mbtowc
always fails.
.El
-.\" ----------------------------------------------------------------------
.Sh RETURN VALUES
Normally,
.Fn mbtowc
.It non-zero
The current encoding is state-dependent.
.El
-.\" ----------------------------------------------------------------------
.Sh EXAMPLES
The following program parses a UTF-8 string and reports encoding errors:
.Bd -literal
.Fa s
points to an invalid or incomplete multibyte character.
.El
-.\" ----------------------------------------------------------------------
.Sh SEE ALSO
.Xr mblen 3 ,
.Xr mbrtowc 3 ,
.Xr setlocale 3
-.\" ----------------------------------------------------------------------
.Sh STANDARDS
The
.Fn mbtowc