xref: /openbsd/lib/libc/locale/towctrans.3 (revision d89ec533)
1.\" $OpenBSD: towctrans.3,v 1.3 2017/09/05 03:16:13 schwarze Exp $
2.\" $NetBSD: towctrans.3,v 1.5 2004/01/24 16:58:54 wiz Exp $
3.\"
4.\" Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org>
5.\" Copyright (c) 2003 Citrus Project
6.\" All rights reserved.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\" 1. Redistributions of source code must retain the above copyright
12.\"    notice, this list of conditions and the following disclaimer.
13.\" 2. Redistributions in binary form must reproduce the above copyright
14.\"    notice, this list of conditions and the following disclaimer in the
15.\"    documentation and/or other materials provided with the distribution.
16.\"
17.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
18.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
21.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27.\" SUCH DAMAGE.
28.\"
29.Dd $Mdocdate: September 5 2017 $
30.Dt TOWCTRANS 3
31.Os
32.Sh NAME
33.Nm towctrans ,
34.Nm towctrans_l
35.Nd convert a wide character with a specified map
36.Sh SYNOPSIS
37.In wctype.h
38.Ft wint_t
39.Fn towctrans "wint_t wc" "wctrans_t charmap"
40.Ft wint_t
41.Fn towctrans_l "wint_t wc" "wctrans_t charmap" "locale_t locale"
42.Sh DESCRIPTION
43These functions convert the wide character
44.Fa wc
45with a character mapping
46.Fa charmap .
47.Pp
48The behaviour is undefined if
49.Fa charmap
50or
51.Fa wc
52is invalid.
53When
54.Fa charmap
55is retrieved with
56.Xr wctrans 3 ,
57it becomes invalid when the thread-specific character encoding locale
58is changed with
59.Xr uselocale 3
60or when the global character encoding locale is changed with
61.Xr setlocale 3 .
62When
63.Fa charmap
64is retrieved with
65.Xr wctrans_l 3 ,
66it is only valid for use with the same
67.Fa locale
68argument.
69.Sh RETURN VALUES
70These functions return the resulting wide character, or
71.Fa wc
72if there is no corresponding character in
73.Fa charmap .
74.Sh SEE ALSO
75.Xr iswctype 3 ,
76.Xr newlocale 3 ,
77.Xr setlocale 3 ,
78.Xr towlower 3 ,
79.Xr wctrans 3
80.Sh STANDARDS
81The
82.Fn towctrans
83function conforms to
84.St -isoC-amd1 ,
85and
86.Fn towctrans_l
87to
88.St -p1003.1-2008 .
89.Sh HISTORY
90The
91.Fn towctrans
92function has been available since
93.Ox 3.8 ,
94and
95.Fn towctrans_l
96since
97.Ox 6.2 .
98