> ncurses-ruby should be linked against libncursesw? (Namely, it would
> enable multibyte Ruby curses programs,

No. It would enable ruby curses programs that use "wide character"
strings. Programs that use multi-byte character strings such as UTF-8
strings would still not run correctly. See my description of display
errors in sup.

The concept of wide characters and wide character strings is not
supported by ruby. Not on the language level, not in the standard
library, not in any library I know of. Ruby 1.9 supports string
encodings, but "wide character" is not one of them. Depending on
compiler, operating system, processor architecture, and locale setting,
wide character width and encoding may be 1 byte (e.g. US-ASCII), 2 or 4
bytes (e.g. UCS-2, UCS-4 with architecture-dependent endianness). The
only portable way to convert a string to wide characters is to use
mbsrtowcs. And this works only for strings encoded in the current locale.

It does not mix well with ruby. Applications would have to store
integers in arrays to emulate wide character strings. I doubt that any
ruby application will ever do this.

> and it wouldn't break anything.)

It should not break anything, but apparently, it does. The non-"wide
character" fuctions of ncurses should behave exactly the same in
libncurses and libncursesw. The effect that you are after is apparently
caused by a bug in ncursesw.

I suppose the difference is caused by the
#if USE_WIDEC_SUPPORT
sections in waddch_nosync() in lib_addch.c, but I don't want to further
investigate in detail.

> Or are you, or anyone else, planning on producing a ncursesw-ruby?

I am not going to implement it myself. It would require wrapping of the
wide character functions of ncursesw, nothing too difficult. But nobody
is ever going to use them, since ruby and the wide character concept do
not work well together, so why bother.

If you want to do this, send me ncursesw_wrap.{h,c} files with wrappers
for add_wch() etc, and I am going to include it if it is complete,
LGPL2, and uses a convincing wstring implementation (e.g. arrays of
integers).

Your other options to get sup working:

1) You may not be aware that ncurses-ruby works fine with non-ascii
characters as long as they are contained in an 8 bit charset. Starting
sup as
LANG=de_DE.ISO-8859-15 xterm -e sup-mail
works for all the characters that I need. (You may need to generate the
locale using locale-gen)

2) Fork ncurses-ruby and distribute your modified version with the
extconf.rb patch applied. It's free software after all. It will work
until the bug in ncursesw that this solution relies on is fixed, albeit
with some display errors.




-- 
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