xref: /openbsd/lib/libc/locale/towctrans.3 (revision 3a628b46)
1*3a628b46Sschwarze.\" $OpenBSD: towctrans.3,v 1.3 2017/09/05 03:16:13 schwarze Exp $
238311d31Sespie.\" $NetBSD: towctrans.3,v 1.5 2004/01/24 16:58:54 wiz Exp $
338311d31Sespie.\"
4*3a628b46Sschwarze.\" Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org>
5*3a628b46Sschwarze.\" Copyright (c) 2003 Citrus Project
638311d31Sespie.\" All rights reserved.
738311d31Sespie.\"
838311d31Sespie.\" Redistribution and use in source and binary forms, with or without
938311d31Sespie.\" modification, are permitted provided that the following conditions
1038311d31Sespie.\" are met:
1138311d31Sespie.\" 1. Redistributions of source code must retain the above copyright
1238311d31Sespie.\"    notice, this list of conditions and the following disclaimer.
1338311d31Sespie.\" 2. Redistributions in binary form must reproduce the above copyright
1438311d31Sespie.\"    notice, this list of conditions and the following disclaimer in the
1538311d31Sespie.\"    documentation and/or other materials provided with the distribution.
1638311d31Sespie.\"
1738311d31Sespie.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1838311d31Sespie.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1938311d31Sespie.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2038311d31Sespie.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
2138311d31Sespie.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2238311d31Sespie.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2338311d31Sespie.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2438311d31Sespie.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2538311d31Sespie.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2638311d31Sespie.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2738311d31Sespie.\" SUCH DAMAGE.
2838311d31Sespie.\"
29*3a628b46Sschwarze.Dd $Mdocdate: September 5 2017 $
3038311d31Sespie.Dt TOWCTRANS 3
3138311d31Sespie.Os
3238311d31Sespie.Sh NAME
33*3a628b46Sschwarze.Nm towctrans ,
34*3a628b46Sschwarze.Nm towctrans_l
3538311d31Sespie.Nd convert a wide character with a specified map
3638311d31Sespie.Sh SYNOPSIS
3738311d31Sespie.In wctype.h
3838311d31Sespie.Ft wint_t
3938311d31Sespie.Fn towctrans "wint_t wc" "wctrans_t charmap"
40*3a628b46Sschwarze.Ft wint_t
41*3a628b46Sschwarze.Fn towctrans_l "wint_t wc" "wctrans_t charmap" "locale_t locale"
4238311d31Sespie.Sh DESCRIPTION
43*3a628b46SschwarzeThese functions convert the wide character
4438311d31Sespie.Fa wc
4538311d31Sespiewith a character mapping
4638311d31Sespie.Fa charmap .
4738311d31Sespie.Pp
48*3a628b46SschwarzeThe behaviour is undefined if
4938311d31Sespie.Fa charmap
50*3a628b46Sschwarzeor
51*3a628b46Sschwarze.Fa wc
52*3a628b46Sschwarzeis invalid.
53*3a628b46SschwarzeWhen
54*3a628b46Sschwarze.Fa charmap
55*3a628b46Sschwarzeis retrieved with
56*3a628b46Sschwarze.Xr wctrans 3 ,
57*3a628b46Sschwarzeit becomes invalid when the thread-specific character encoding locale
58*3a628b46Sschwarzeis changed with
59*3a628b46Sschwarze.Xr uselocale 3
60*3a628b46Sschwarzeor when the global character encoding locale is changed with
61*3a628b46Sschwarze.Xr setlocale 3 .
62*3a628b46SschwarzeWhen
63*3a628b46Sschwarze.Fa charmap
64*3a628b46Sschwarzeis retrieved with
65*3a628b46Sschwarze.Xr wctrans_l 3 ,
66*3a628b46Sschwarzeit is only valid for use with the same
67*3a628b46Sschwarze.Fa locale
68*3a628b46Sschwarzeargument.
6938311d31Sespie.Sh RETURN VALUES
70*3a628b46SschwarzeThese functions return the resulting wide character, or
71*3a628b46Sschwarze.Fa wc
72*3a628b46Sschwarzeif there is no corresponding character in
73*3a628b46Sschwarze.Fa charmap .
7438311d31Sespie.Sh SEE ALSO
7538311d31Sespie.Xr iswctype 3 ,
76*3a628b46Sschwarze.Xr newlocale 3 ,
7738311d31Sespie.Xr setlocale 3 ,
78*3a628b46Sschwarze.Xr towlower 3 ,
79*3a628b46Sschwarze.Xr wctrans 3
8038311d31Sespie.Sh STANDARDS
8138311d31SespieThe
8238311d31Sespie.Fn towctrans
8338311d31Sespiefunction conforms to
84*3a628b46Sschwarze.St -isoC-amd1 ,
85*3a628b46Sschwarzeand
86*3a628b46Sschwarze.Fn towctrans_l
87*3a628b46Sschwarzeto
88*3a628b46Sschwarze.St -p1003.1-2008 .
89*3a628b46Sschwarze.Sh HISTORY
90*3a628b46SschwarzeThe
91*3a628b46Sschwarze.Fn towctrans
92*3a628b46Sschwarzefunction has been available since
93*3a628b46Sschwarze.Ox 3.8 ,
94*3a628b46Sschwarzeand
95*3a628b46Sschwarze.Fn towctrans_l
96*3a628b46Sschwarzesince
97*3a628b46Sschwarze.Ox 6.2 .
98