Package: libruby1.8
Version: 1.8.7.302-2
Severity: normal

*** Please type your report below this line ***

Hello maintaner.

I tried to make ruby program which use curses.

But ja_JP.utf8 environment prevent me display Japanese
character. If you know better solution, please let me
know.

I read article (http://codezine.jp/article/detail/2086).
Sorry, That article is written in Japanese.

Quote basic script.
-------------------------------------------------------------
require "curses"

Curses::init_screen
Curses::setpos(5, 2)
Curses::addstr("Cursesの世界にようこそ")
Curses::refresh
Curses::getch
Curses::close_screen
-------------------------------------------------------------

I ran above script. But, Japanese were scrambled(Many Japanese
called "mojibake")

I guess that libruby needs to link libncursesw which is wide
character supported . but it is seems to me libruby linked
libncurses which is not wide charater supported.

-------------------------------------------------------------
yabuki@yelona:~$ ldd /usr/lib/ruby/1.8/i486-linux/curses.so
        linux-gate.so.1 =>  (0xb77d0000)
        libruby1.8.so.1.8 => /usr/lib/libruby1.8.so.1.8 (0xb76c8000)
        libncurses.so.5 => /lib/libncurses.so.5 (0xb768e000)
        libpthread.so.0 => /lib/i686/cmov/libpthread.so.0 (0xb7674000)
        librt.so.1 => /lib/i686/cmov/librt.so.1 (0xb766b000)
        libdl.so.2 => /lib/i686/cmov/libdl.so.2 (0xb7667000)
        libcrypt.so.1 => /lib/i686/cmov/libcrypt.so.1 (0xb7635000)
        libm.so.6 => /lib/i686/cmov/libm.so.6 (0xb760f000)
        libc.so.6 => /lib/i686/cmov/libc.so.6 (0xb74c8000)
        /lib/ld-linux.so.2 (0xb77d1000)

yabuki@yelona:~$ sudo ls -la /lib/libncu*
[sudo] password for yabuki:
lrwxrwxrwx 1 root root     17 2011-04-10 18:07 /lib/libncurses.so.5 ->
libncurses.so.5.7 -rw-r--r-- 1 root root 231576 2011-01-04
20:05 /lib/libncurses.so.5.7 lrwxrwxrwx 1 root root     18 2011-04-10
18:09 /lib/libncursesw.so.5 -> libncursesw.so.5.7 -rw-r--r-- 1 root root
282648 2011-01-04 20:05 /lib/libncursesw.so.5.7

-------------------------------------------------------------

I googled this issue. I found
http://projectzero-swb.blogspot.com/2010/02/ruby191cursesutf-8.html
(Sorry, This page is written in Japanese too.)

That web page said:
(1) edit ext/curses/curses.c
(1-1) add #include locale.h
(1-2) add setlcale(LC_ALL, "") in init_curses()
(2) edit ext/curses/extconf.rb
(2-1) search ncursesw (*AC macro does not fit for ruby 1.8.7)
(2-2) if you fail build, you should set option optflags="-O3 -pipe"

-- System Information:
Debian Release: 6.0.1
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.32-5-686 (SMP w/2 CPU cores)
Locale: LANG=ja_JP.UTF-8, LC_CTYPE=ja_JP.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages libruby1.8 depends on:
ii  libc6                   2.11.2-10        Embedded GNU C Library:
Shared lib ii  libgdbm3                1.8.3-9          GNU dbm database
routines (runtime ii  libncurses5             5.7+20100313-5   shared
libraries for terminal hand ii  libreadline5            5.2-7
GNU readline and history libraries ii  libssl0.9.8
0.9.8o-4squeeze1 SSL shared libraries ii  zlib1g
1:1.2.3.4.dfsg-3 compression library - runtime

libruby1.8 recommends no packages.

libruby1.8 suggests no packages.

-- no debconf information


--
====+====+====+====+====+====+====+====+====+====+====+====+====+====+
Yukiharu Yabuki (矢吹幸治)                      I use Debian GNU/Linux
mail: yab...@netfort.gr.jp
クレクレタコラは好き / クレクレタコだはイヤ
====+====+====+====+====+====+====+====+====+====+====+====+====+====+



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to