curses

S

Shawn Whoo

I am an elementary user of ruby,i meet a problem about ruby curses.
source code as follow:

require "curses"
include Curses
init_screen
begin
crmode
echo
ch = getstr #problem occurred here
noecho
ensure
close_screen
end

I input some 2-byte-word (like chinese word) from the keyboard,but the
screen do not show the right result, finally I find that :
1) I input only one 2-byte-word from the keyboard , the screen show me
the first byte of the word but abandon the another byte of the word .
2) I input two 2-byte-words from the keyboard, the second byte of each
of the two 2-byte-words was abandoned, and the screen show me the result
that it recompose a 2-byte-word by the first byte of each of the two
2-byte-words
 
J

John Joyce

It sounds like curses doesn't support unicode I looked around a
little
bit on google and it looks like if you download the curses source
code,
there is a way to compile it with unicode support. See the cached
page
here:

http://72.14.205.104/search?q=cache:hI2PRe3SbOoJ:nullref.se/blog/
2006/5/9/ruby-curses-unicode+ruby+unicode
+curses&hl=en&ct=clnk&cd=1&gl=us&client=safari
You might want to check out the recent Ncurses book from Dan Gookin.
It's in C, but so is curses anyway.
It should be adaptable to the Ruby gem version...
 
S

Shawn Whoo

thank you all very much!
I solve the problem with another way to get the chinese word input by
using readline.so!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top