From: Simon Strandgaard Date: 2004-12-22T16:29:46+09:00 Subject: Re: curses - how to use unicode On Wed, 22 Dec 2004 11:58:29 +0900, Carlos wrote: [snip] > On the other hand, the parameters to "addn?wstr" are wchar_t *, which I > think are defined as 32 bit integers. So I guess you should either use > "pack('L*')", or change the function declaration. Using addwstr with pack("L*") doesn't seem to work for me either. How would a good representation of wchar_t string be like? # # Using ncurses-5.4 with --enable-widec --with-shared # require 'dl/import' module Curses extend DL::Importable dlload "libncursesw.so" typealias "WINDOW", "void*" extern "int addstr(const char *)" extern "int cbreak()" extern "int endwin()" extern "int getch()" extern "WINDOW initscr()" extern "int noecho()" extern "int refresh()" extern "int addwstr(const unsigned long *)" extern "int addnwstr(const unsigned long *, int)" end str = [0x250c, 0x2510, 10, 0x2514, 0x2518].pack("L*") Curses.initscr Curses.cbreak Curses.noecho Curses.addnwstr(str, str.size) # no box.. Curses.getch Curses.endwin -- Simon Strandgaard