From: Simon Strandgaard Date: 2004-12-22T07:41:16+09:00 Subject: Re: curses - how to use unicode [snip] I have compiled ncurses-5.4 with --enable-widec --with-shared. I now have a "libncursesw.so" file.. I am still unsure what function I should use in order to output UTF-8 encoded strings.. or if I should output with another unicode encoding? require 'dl/import' module Curses extend DL::Importable dlload "libncursesw.so" typealias "WINDOW", "void*" typealias "wchar_t", "unsigned long" extern "int add_wch(const char *)" extern "int addstr(const char *)" extern "int cbreak()" extern "int curs_set(int)" extern "int endwin()" extern "int getch()" extern "WINDOW initscr()" extern "int noecho()" extern "int refresh()" # is const char * correct here ? extern "int add_wchstr(const char *)" extern "int add_wchnstr(const char *, int)" end str = [0x250c, 0x2510, 10, 0x2514, 0x2518].pack("U*") + "\000" p str # -> "\342\224\214\342\224\220\n\342\224\224\342\224\230\000" puts str # this renders a nice box gets Curses.initscr Curses.cbreak Curses.noecho Curses.add_wchstr(str) # no box.. Curses.getch Curses.endwin -- Simon Strandgaard