Bug #975

ruby curses extension does not support multibyte characters

Added by Michal Suchanek about 3 years ago. Updated 10 months ago.

[ruby-core:21094]
Status:Closed Start date:01/04/2009
Priority:Normal Due date:
Assignee:- % Done:

100%

Category:ext
Target version:1.9.1 RC2
ruby -v:

Description

ncurses supplies a ncursesw library that works as drop-in replacement for the ncurses with added multibyte character support. Just updating the library test enables printing UTF-8 for me.

test (run with ruby -KU) in utf-8 locale:

require 'curses'

test_string = "あ"

Curses.init_screen

Curses.addstr test_string

Curses.refresh

Curses.getch

Curses.close_screen

STDOUT.puts test_string

cursesw.patch - a patch to add transparent multibyte support with ncurses (864 Bytes) Michal Suchanek, 01/04/2009 03:18 am

Associated revisions

Revision 21508
Added by Yukihiro Matsumoto about 3 years ago

* ext/curses/extconf.rb: check ncursesw earlier than ncurses to support UTF-8 strings. non UTF-8 strings should be converted explicitly. [ruby-core:21094]

History

Updated by Yukihiro Matsumoto about 3 years ago

In message "Re: [ruby-core:21094] [Bug #975] ruby curses extension does not support multibyte characters"
    on Sun, 4 Jan 2009 03:17:20 +0900, Michal Suchanek <redmine@ruby-lang.org> writes:

|ncurses supplies a ncursesw library that works as drop-in replacement for the ncurses with added multibyte character support. Just updating the library test enables printing UTF-8 for me.

As far as I know, ncursesw is NOT a drop-in replacement.  It has whole
new API around cchar_t, wchar_t and wint_t, e.g. wadd_wch in place of
waddch.  Am I missing something?

							matz.

Updated by Michal Suchanek about 3 years ago

On 03/01/2009, Yukihiro Matsumoto <matz@ruby-lang.org> wrote:
>
>  In message "Re: [ruby-core:21094] [Bug #975] ruby curses extension does not support multibyte characters"
>
>     on Sun, 4 Jan 2009 03:17:20 +0900, Michal Suchanek <redmine@ruby-lang.org> writes:
>
>  |ncurses supplies a ncursesw library that works as drop-in replacement for the ncurses with added multibyte character support. Just updating the library test enables printing UTF-8 for me.
>
>
> As far as I know, ncursesw is NOT a drop-in replacement.  It has whole
>  new API around cchar_t, wchar_t and wint_t, e.g. wadd_wch in place of
>  waddch.  Am I missing something?
>
Yes.

You do not need to use that additional wide character API to get utf-8
characters printed on the screen.

Thanks

Michal

Updated by Yukihiro Matsumoto about 3 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100
Applied in changeset r21508.

Also available in: Atom PDF