dankamongmen / notcurses

blingful character graphics/TUI library. definitely not curses.
https://nick-black.com/dankwiki/index.php/Notcurses
Other
3.4k stars 113 forks source link

Eliminate encoding check in ncnmetric() #2782

Closed dankamongmen closed 1 month ago

dankamongmen commented 1 month ago

We had a grotesque pthread_once() + nl_langinfo() in ncnmetric(). The alternative would be accepting a const struct notcurses* (and breaking API). This was broken, as shown in #2779. We want to use the advanced detection mechanisms of notcurses_init() and ncdirect_init(). Enable this from those functions, then, across the continued lifetime of the process. Document this somewhat unorthodox choice and (possibly) surprising behavior in the BUGS section of notcurses_metric(3).

Use encoding_is_utf8() in ncdirect_init().

Closes #2779 Closes #2780