[Gambas-user] NCURSES ACS_STERLING

Tobias Boege taboege at gmail.com
Sat May 25 11:33:53 CEST 2019


On Sat, 25 May 2019, KKing wrote:
> under gambas ncurses (with Xterm Debian LXDE) if I do
>     Window.Print("UK pound symbol: £")
> 
> I get
>     UK pound symbol: M-BM-*
> 
> If I do either below in Xterm in C the pound symbol is displayed okay in
> both cases.
>     printw("UK pound symbol attempt one £ ");printw("\n");
>     printw("UK pound symbol attempt two ");
> addch(ACS_STERLING);printw("\n");
> i.e. I get
>     UK pound symbol attempt one £
>     UK pound symbol attempt two £
> 

Unicode support is flaky in gb.ncurses, but just a Window.Print() with
a UTF-8 encoded string should work if your terminal is set up correctly
for that. It works here on Konsole, urxvt and xterm under en_US.utf8
locale (doesn't under C locale FWIW). The fact that you get M-BM-*
suggests [1] that your terminal does not handle UTF-8.

I could also add the ACS constants to gb.ncurses. Fixing its unicode
support overall is a bigger deal. It's the small stuff like determining
string length or checking if a character (in a char[]!) is a newline
that's scattered all over the place assuming ASCII encoded strings.
gb.ncurses does link against the ncursesw library which supports wide
characters, however.

Regards,
Tobi

[1] First sentence in an otherwise unrelated answer: https://askubuntu.com/a/358746

-- 
"There's an old saying: Don't change anything... ever!" -- Mr. Monk


More information about the User mailing list