ruby / curses

Ruby binding for curses, ncurses, and PDCurses. Formerly part of the ruby standard library.
Other
297 stars 34 forks source link

Not Displaying Wide Characters #61

Closed ninp0 closed 3 years ago

ninp0 commented 3 years ago

Despite:

$ sudo apt install libncursesw5 libncursesw5-dev

window.box(' ', "\u2500")

outputs a horizontal block of gray text instead of a nice horizontal box line.

What steps are needed to display wide unicode characters using the curses gem?

I can confirm the version of ruby does properly output the unicode I expect:

 puts "\u2500"*9
─────────
shugo commented 3 years ago

box doesn't support multibyte characters. Try the following code to check multibyte support:

Curses.init_screen
Curses.addstr("\u2500" * 9 + "\nEnter: ")
Curses.getch
Curses.close_screen
ninp0 commented 3 years ago

That worked for my needs - thanks!