]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/legacy_coding.3x
ncurses 6.4 - patch 20240420
[ncurses.git] / man / legacy_coding.3x
1 .\"***************************************************************************
2 .\" Copyright 2020-2023,2024 Thomas E. Dickey                                *
3 .\" Copyright 2005-2016,2017 Free Software Foundation, Inc.                  *
4 .\"                                                                          *
5 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
6 .\" copy of this software and associated documentation files (the            *
7 .\" "Software"), to deal in the Software without restriction, including      *
8 .\" without limitation the rights to use, copy, modify, merge, publish,      *
9 .\" distribute, distribute with modifications, sublicense, and/or sell       *
10 .\" copies of the Software, and to permit persons to whom the Software is    *
11 .\" furnished to do so, subject to the following conditions:                 *
12 .\"                                                                          *
13 .\" The above copyright notice and this permission notice shall be included  *
14 .\" in all copies or substantial portions of the Software.                   *
15 .\"                                                                          *
16 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
17 .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
18 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
19 .\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
20 .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
21 .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
22 .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
23 .\"                                                                          *
24 .\" Except as contained in this notice, the name(s) of the above copyright   *
25 .\" holders shall not be used in advertising or otherwise to promote the     *
26 .\" sale, use or other dealings in this Software without prior written       *
27 .\" authorization.                                                           *
28 .\"***************************************************************************
29 .\"
30 .\" Author: Thomas E. Dickey
31 .\"
32 .\" $Id: legacy_coding.3x,v 1.28 2024/04/20 19:13:50 tom Exp $
33 .TH legacy_coding 3X 2024-04-20 "ncurses @NCURSES_MAJOR@.@NCURSES_MINOR@" "Library calls"
34 .SH NAME
35 \fB\%use_legacy_coding\fP \-
36 override \fIcurses\fR locale encoding checks
37 .SH SYNOPSIS
38 .nf
39 \fB#include <curses.h>
40 .PP
41 \fBint use_legacy_coding(int \fIlevel\fP);
42 .fi
43 .SH DESCRIPTION
44 .B \%use_legacy_coding
45 is an extension to the
46 .I curses
47 library.
48 It allows the caller to change the result of \fB\%unctrl\fP(3X),
49 suppressing \fI\%isprint\fP(3)-based checks within the library that
50 would normally cause nonprinting characters to be rendered in visible
51 form.
52 The alteration affects only eight-bit characters.
53 .PP
54 The
55 .I level
56 parameter controls the result.
57 .RS
58 .TP 5
59 .B 0
60 The library functions normally,
61 rendering nonprinting characters as described in \fB\%unctrl\fP(3X),
62 .TP
63 .B 1
64 the library ignores
65 .I \%isprint
66 for codes in the range 160-255.
67 .TP
68 .B 2
69 the library ignores
70 .I \%isprint
71 for codes in the range 128-255.
72 It also modifies the output of \fB\%unctrl\fP(3X),
73 showing codes in the range 128-159 as is.
74 .RE
75 .SH RETURN VALUE
76 If the screen has not been initialized,
77 or the
78 .I level
79 parameter is out of range,
80 .B \%use_legacy_coding
81 returns
82 .BR ERR .
83 Otherwise,
84 it returns the previous level:
85 .BR 0 ,
86 .BR 1 ,
87 or
88 .BR 2 .
89 .SH PORTABILITY
90 .B \%use_legacy_coding
91 is specific to
92 .IR \%ncurses .
93 It was not supported on Version 7, BSD or System V implementations.
94 Applications employing
95 .I \%ncurses
96 extensions should condition their use on the visibility of the
97 .B \%NCURSES_VERSION
98 preprocessor macro.
99 .SH AUTHORS
100 Thomas Dickey
101 (to support \fI\%lynx\fP(1)'s font-switching feature).
102 .SH SEE ALSO
103 \fB\%unctrl\fP(3X)