Subj : Ncurses and extended ASCI
To   : Joseph Larsen
From : Kevin Lamonte
Date : Thu Jul 18 2019 02:48 pm

-=> Joseph Larsen wrote to All <=-

 JL> Hi,

 JL> After some time in the hospital, i've started work on igTerm again.
 JL> I'm having problems with it (igTerm) not displaying extended ASCII
 JL> characters as it should, in ncurses. Rather than the actual character,
 JL> it'll display ^B for example. I'm not sure how to go about solving
 JL> this. This is in the C programming language. I've made some progress...
 JL> however, this problem remains. Any and all help is appreciated.

If you are trying to get CP437 glyphs on the screen, your best modern
solution with ncurses is to use Unicode.  I've got some ncurses
pointers over at https://gitlab.com/klamonte/terminal-snippets.  This
one might help you:

Screen: How Do I Output Unicode?
--------------------------------

Use setcchar(), mvwadd_wch(), and wadd_wch().  For lines, use
mvwhline_set() and mvwvline_set().  Example code:

```
    cchar_t ncurses_ch;
    wchar_t wch[2];
    wch[0] = ch;
    wch[1] = 0;
    setcchar(&ncurses_ch, wch, A_NORMAL, 0, NULL);
    mvwadd_wch(stdscr, y, x, &ncurses_ch);
```

This example just spits one code point to screen.  It is possible to
add more code points for the same cell (e.g. accents), just make wch[]
bigger and put more code points in the array.

.....

Best of luck.


.... MultiMail, the new multi-platform, multi-format offline reader!
--- MultiMail/Linux v0.49