legacy_coding(3X)
π legacy_coding β the ncurses library calls, bestie edition π
okay so real talk, this page lives in the ncurses library calls section, and it's all about use_legacy_coding. she's a little extension, she's a little niche, and she is SO fun once you get her. let's go β¨
πΈ NAME πΈ
use_legacy_coding β override curses locale encoding checks
π SYNOPSIS π
#include <curses.h>
int use_legacy_coding(int level);
β¨ DESCRIPTION β¨
so use_legacy_coding is an ncurses extension to the curses library (yes, an extension, we'll get to that in a sec π
). what she does is let you customize the behavior of unctrl(3X), by suppressing isprint(3)-based checks inside the library β the ones that would normally make nonprinting characters get rendered in visible form.
important vibe check tho: this alteration only affects byte-wide characters with the most significant bit set. that's the whole scope. no cap.
the level parameter is what controls the result, and she's got three moods:
0β the library functions normally, rendering nonprinting characters as described inunctrl(3X).1β the library ignoresisprintfor codes in the range 160-255.2β the library ignoresisprintfor codes in the range 128-255. it also modifies the output ofunctrl(3X), showing codes in the range 128-159 as is.
π«Ά RETURN VALUE π«Ά
if the curses screen has not been initialized, or if the level parameter is out of range, use_legacy_coding returns ERR. π
otherwise? she returns the previous level. cute, right? she's a gossip, she tells you what came before.
π EXTENSIONS π
use_legacy_coding is an ncurses extension. that's it, that's the note. she's not standard-library-core, she's ncurses-exclusive main character energy π
π¦ PORTABILITY π¦
apps that employ ncurses extensions should condition their use on the visibility of the NCURSES_VERSION preprocessor macro.
like. if you're gonna use her, check that she's even invited to the party first. fr fr.
π HISTORY π
ncurses 5.6 (2006) introduced use_legacy_coding to support lynx(1)'s font-switching feature. iconic origin story honestly, she was built for a browser π§
β AUTHORS β
Thomas Dickey
π₯ SEE ALSO π₯
unctrl(3X)
and that's the whole page, babe π this one shipped in ncurses 6.6, dated 2024-09-14 β go forth and encode responsibly πβ¨
π¦ where this page comes from
- alpine 3.24: ncurses-doc 6.6_p20260516-r0 Β· X11
- arch rolling: ncurses 6.6-2 Β· MIT-open-group
- fedora 44: ncurses-devel 6.6-1.fc44 Β· MIT-open-group
- fedora 44: ncurses-devel 6.6-1.fc44 Β· MIT-open-group
- Copyright 2020-2023,2024 Thomas E. Dickey
- Copyright 2005-2016,2017 Free Software Foundation, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms