legacy\_coding(3X) Library calls legacy\_coding(3X)

# [NAME](#NAME)

**use\_legacy\_coding** - override *curses* locale encoding checks

# [SYNOPSIS](#SYNOPSIS)

```
#include <curses.h>
```

```
int use_legacy_coding(int level);
```

# [DESCRIPTION](#DESCRIPTION)

**use\_legacy\_coding**, an *ncurses* extension to the *curses* library, permits customiztion of [**unctrl**(3X)](/man/os/ncurses/unctrl.3X) behavior, suppressing [*isprint*(3)](/man/os/ncurses/isprint.3)-based checks within the library that would normally cause nonprinting characters to be rendered in visible form. The alteration affects only byte-wide characters with the most significant bit set.

The *level* parameter controls the result.

**0**

The library functions normally, rendering nonprinting characters as described in [**unctrl**(3X)](/man/os/ncurses/unctrl.3X),

**1**

the library ignores *isprint* for codes in the range 160-255.

**2**

the library ignores *isprint* for codes in the range 128-255. It also modifies the output of [**unctrl**(3X)](/man/os/ncurses/unctrl.3X), showing codes in the range 128-159 as is.

# [RETURN VALUE](#RETURN_VALUE)

If the *curses* screen has not been initialized, or the *level* parameter is out of range, **use\_legacy\_coding** returns **ERR**. Otherwise, it returns the previous level.

# [EXTENSIONS](#EXTENSIONS)

**use\_legacy\_coding** is an *ncurses* extension.

# [PORTABILITY](#PORTABILITY)

Applications employing *ncurses* extensions should condition their use on the visibility of the **NCURSES\_VERSION** preprocessor macro.

# [HISTORY](#HISTORY)

*ncurses* 5.6 (2006) introduced *use\_legacy\_coding* to support [*lynx*(1)](/man/os/ncurses/lynx.1)'s font-switching feature.

# [AUTHORS](#AUTHORS)

Thomas Dickey

# [SEE ALSO](#SEE_ALSO)

[**unctrl**(3X)](/man/os/ncurses/unctrl.3X)

2024-09-14 ncurses 6.6

---

Document: use_legacy_coding(3x) from ncurses 6.6.20261031-r0 (Chainguard OS)
Source: https://github.com/ThomasDickey/ncurses-snapshots
