.Dt WCRTOMB 3
.Os
.Sh NAME
-.Nm wcrtomb
+.Nm wcrtomb ,
+.Nm wcrtomb_l
.Nd "convert a wide-character code to a character (restartable)"
.Sh LIBRARY
.Lb libc
.Sh SYNOPSIS
.In wchar.h
.Ft size_t
-.Fn wcrtomb "char * restrict s" "wchar_t wc" "mbstate_t * restrict ps"
+.Fo wcrtomb
+.Fa "char *restrict s"
+.Fa "wchar_t wc"
+.Fa "mbstate_t *restrict ps"
+.Fc
+.In wchar.h
+.In xlocale.h
+.Ft size_t
+.Fo wcrtomb_l
+.Fa "char *restrict s"
+.Fa "wchar_t wc"
+.Fa "mbstate_t *restrict ps"
+.Fa "locale_t loc"
+.Fc
.Sh DESCRIPTION
The
.Fn wcrtomb
.Fa wc ,
including any necessary shift sequences, to the
character array
-.Fa s ,
-storing a maximum of
+.Fa s .
+A maximum of
.Dv MB_CUR_MAX
-bytes.
+bytes will be stored.
.Pp
If
.Fa s
.Fa s
pointed to an internal buffer and
.Fa wc
-was a null wide character (L'\e0').
+were a null wide character (L'\e0').
.Pp
The
.Ft mbstate_t
.Vt mbstate_t
object, which is initialized to the initial conversion state
at program startup.
+.Pp
+While the
+.Fn wcrtomb
+function uses the current locale, the
+.Fn wcrtomb_l
+function may be passed a locale directly. See
+.Xr xlocale 3
+for more information.
.Sh RETURN VALUES
The
.Fn wcrtomb
.Xr mbrtowc 3 ,
.Xr multibyte 3 ,
.Xr setlocale 3 ,
-.Xr wctomb 3
+.Xr wctomb 3 ,
+.Xr xlocale 3
.Sh STANDARDS
The
.Fn wcrtomb