# Curses

**URL:** <https://www.ruby-forum.com/t/curses/116170>\
**Category:** Ruby\
**Created:** [October 3, 2007, 4:54am UTC](https://www.ruby-forum.com/t/curses/116170 "2007-10-03T04:54:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![shawn\_2008](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/df788c/32.png) [@shawn\_2008](https://www.ruby-forum.com/u/shawn_2008)\
**Post date:** [October 3, 2007, 4:54am UTC](https://www.ruby-forum.com/t/curses/116170/1 "2007-10-03T04:54:19Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![shawn\_2008](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/df788c/32.png) [@shawn\_2008](https://www.ruby-forum.com/u/shawn_2008)\
**Post date:** [October 3, 2007, 6:39am UTC](https://www.ruby-forum.com/t/curses/116170/2 "2007-10-03T06:39:40Z")

</div>

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](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)

---

<div class="post-metadata">

**Author:** ![shawn\_2008](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/df788c/32.png) [@shawn\_2008](https://www.ruby-forum.com/u/shawn_2008)\
**Post date:** [October 3, 2007, 7:07am UTC](https://www.ruby-forum.com/t/curses/116170/3 "2007-10-03T07:07:09Z")

</div>

On Oct 2, 2007, at 11:39 PM, 7stud – wrote:

> ## +curses&hl=en&ct=clnk&cd=1&gl=us&client=safari
> 
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

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…

---

<div class="post-metadata">

**Author:** ![shawn\_2008](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/df788c/32.png) [@shawn\_2008](https://www.ruby-forum.com/u/shawn_2008)\
**Post date:** [October 4, 2007, 9:09am UTC](https://www.ruby-forum.com/t/curses/116170/4 "2007-10-04T09:09:19Z")

</div>

thank you very much!  
but i can call addstr to show chinese word!

---

<div class="post-metadata">

**Author:** ![shawn\_2008](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/df788c/32.png) [@shawn\_2008](https://www.ruby-forum.com/u/shawn_2008)\
**Post date:** [October 4, 2007, 9:11am UTC](https://www.ruby-forum.com/t/curses/116170/5 "2007-10-04T09:11:43Z")

</div>

7stud – wrote:

> 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](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)

i am sorry about that i cann’t access the url above!

---

<div class="post-metadata">

**Author:** ![shawn\_2008](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/df788c/32.png) [@shawn\_2008](https://www.ruby-forum.com/u/shawn_2008)\
**Post date:** [October 5, 2007, 7:30am UTC](https://www.ruby-forum.com/t/curses/116170/6 "2007-10-05T07:30:06Z")

</div>

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