Closed soanvig closed 5 years ago
The following C program also doesn't work with ncurses.
#include <ncurses.h>
int main()
{
initscr();
WINDOW *win = newwin(9, 40, 5, 20);
mvwaddstr(win, 4, 15, "Hit ay key");
box(win, 0x2502, 0x2500);
touchwin(win);
wrefresh(win);
getchar();
endwin();
return 0;
}
Do you have any version of curses whose box() supports Unicode?
This is not problem of ruby curses bindings, using chars like that is more complicated in ncurses in general Try something like that:
win.attron(Curses::A_ALTCHARSET)
win.box(120, 113)
win.attroff(Curses::A_ALTCHARSET)
win.refresh
Keyword: Ncurses extended characters :) There should be constants from original ncurses library embedded into ruby curses bindings, but currently there arent any :(
@sh7d Thanks for your comment.
I close this issue because it's not an issue of Ruby bindings.
Hi.
The
.box()
method does not work with UTF-8 characters.window.box('│', '─')
leads to displayingâ
character (it is grey rectangle in my terminal).Where these dashes are box-drawing characters copied directly into the code (with unicode transcription it doesn't work either).
What works however is UTF-8, but with
.addstr()
method.Curses 1.2.4 Ruby 2.4 Fedora 25