| 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.32 2024/09/14 20:06:50 tom Exp $ |
| 33 |
.TH legacy_coding 3NCURSES 2024-09-14 "ncurses 6.6" "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 |
.BR \%use_legacy_coding "," |
| 45 |
an |
| 46 |
.I \%ncurses |
| 47 |
extension to the |
| 48 |
.I curses |
| 49 |
library, |
| 50 |
permits customiztion of \fB\%unctrl\fP(3NCURSES) behavior, |
| 51 |
suppressing \fI\%isprint\fP(3)-based checks within the library that |
| 52 |
would normally cause nonprinting characters to be rendered in visible |
| 53 |
form. |
| 54 |
The alteration affects only byte-wide characters with the most |
| 55 |
significant bit set. |
| 56 |
.PP |
| 57 |
The |
| 58 |
.I level |
| 59 |
parameter controls the result. |
| 60 |
.RS |
| 61 |
.TP 5 |
| 62 |
.B 0 |
| 63 |
The library functions normally, |
| 64 |
rendering nonprinting characters as described in \fB\%unctrl\fP(3NCURSES), |
| 65 |
.TP |
| 66 |
.B 1 |
| 67 |
the library ignores |
| 68 |
.I \%isprint |
| 69 |
for codes in the range 160-255. |
| 70 |
.TP |
| 71 |
.B 2 |
| 72 |
the library ignores |
| 73 |
.I \%isprint |
| 74 |
for codes in the range 128-255. |
| 75 |
It also modifies the output of \fB\%unctrl\fP(3NCURSES), |
| 76 |
showing codes in the range 128-159 as is. |
| 77 |
.RE |
| 78 |
.SH RETURN VALUE |
| 79 |
If the |
| 80 |
.I curses |
| 81 |
screen has not been initialized, |
| 82 |
or the |
| 83 |
.I level |
| 84 |
parameter is out of range, |
| 85 |
.B \%use_legacy_coding |
| 86 |
returns |
| 87 |
.BR ERR . |
| 88 |
Otherwise, |
| 89 |
it returns the previous level. |
| 90 |
.SH EXTENSIONS |
| 91 |
.B \%use_legacy_coding |
| 92 |
is an |
| 93 |
.I \%ncurses |
| 94 |
extension. |
| 95 |
.SH PORTABILITY |
| 96 |
Applications employing |
| 97 |
.I \%ncurses |
| 98 |
extensions should condition their use on the visibility of the |
| 99 |
.B \%NCURSES_VERSION |
| 100 |
preprocessor macro. |
| 101 |
.SH HISTORY |
| 102 |
.I \%ncurses |
| 103 |
5.6 (2006) introduced |
| 104 |
.I \%use_legacy_coding |
| 105 |
to support \fI\%lynx\fP(1)'s font-switching feature. |
| 106 |
.SH AUTHORS |
| 107 |
Thomas Dickey |
| 108 |
.SH SEE ALSO |
| 109 |
\fB\%unctrl\fP(3NCURSES) |