From: Simon Strandgaard Date: 2004-12-22T05:40:09+09:00 Subject: Re: curses - how to use unicode On Tue, 21 Dec 2004 20:52:02 +0900, Thomas Dickey wrote: > Simon Strandgaard wrote: > > Yesterday I got xterm working with UTF-8. I had made an oneliner that > > outputted a small box. > > > puts [0x250c, 0x2510, 10, 0x2514, 0x2518].pack("U*") > > > When I try the same through curses.. then no unicode. > > I don't see the small box. > > very likely ruby's package for curses doesn't link with the wide-character > variation (libncursesw for ncurses versus libncurses). That's needed to > build up the contents of each cell on the screen (internally Unicode). Ok.. I have now tried to use the lib directly from ruby. It still outputs garbage. I am unsure if im using the right calls for outputting ? require 'dl/import' module Curses extend DL::Importable dlload "libcurses.so" typealias "WINDOW", "void*" typealias "attr_t", "unsigned long" extern "WINDOW initscr()" extern "int endwin()" extern "int getch()" extern "int cbreak()" extern "int noecho()" extern "int refresh()" extern "int addstr(const char *)" end Curses.initscr Curses.cbreak Curses.noecho s = [0x250c, 0x2510, 10, 0x2514, 0x2518].pack("U*")+0.chr Curses.addstr(s) Curses.refresh Curses.getch Curses.endwin Im now trying to install ncurses-5.4 to see if it makes a difference. btw: Thomas E. Dickey you amaze me everytime you find xterm/ncurses related stuff in different newsgroups.. how do you do? -- Simon Strandgaard