Ncurses ruby and utf-8

hello group,

I'm writing a small application using ncurses and I wonder how to make
it output and input utf-8 characters. I also have a readline interface
to the program, and there I can input things like û ö ñ etc. quite
fine, using the ncurses routines it chokes.
I'm using the getstr(str) call for text input.

Thanks,

Brian

···

--
Brian Schröder
http://ruby.brian-schroeder.de/

* Brian Schröder (Mar 07, 2005 13:40):

I'm writing a small application using ncurses and I wonder how to make
it output and input utf-8 characters. I also have a readline interface
to the program, and there I can input things like û ö ñ etc. quite
fine, using the ncurses routines it chokes. I'm using the getstr(str)
call for text input.

You need ncursesw (configure --enable-widec).

Check the archive (http://www.ruby-talk.org/\) for previous discussions
(Simon Strandgaard has done some investigation into using it from Ruby).

The ruby-ncurses package currently doesn't support wide character
ncurses,
  nikolai

···

--
::: name: Nikolai Weibull :: aliases: pcp / lone-star / aka :::
::: born: Chicago, IL USA :: loc atm: Gothenburg, Sweden :::
::: page: www.pcppopper.org :: fun atm: gf,lps,ruby,lisp,war3 :::
main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}

What is the general state of unicode support in ruby?

···

On Monday 07 March 2005 12:48, Nikolai Weibull wrote:

The ruby-ncurses package currently doesn't support wide character
ncurses,
nikolai

--
Lee.

[snip]

You need ncursesw (configure --enable-widec).

Check the archive (http://www.ruby-talk.org/\) for previous discussions
(Simon Strandgaard has done some investigation into using it from Ruby).

I wrote a small .c wrapper for ncursesw.
See code here:
http://rubyforge.org/cgi-bin/viewcvs.cgi/*checkout*/projects/experimental/buffer2/source/tui.c?rev=1.4&cvsroot=aeditor

···

On Mon, 7 Mar 2005 21:48:54 +0900, Nikolai Weibull <mailing-lists.ruby-talk@rawuncut.elitemail.org> wrote:

--
Simon Strandgaard

* Lee Braiden (Mar 07, 2005 14:40):

What is the general state of unicode support in ruby?

There is none, beyond a very hackish one for regular expression
matching via the $KCODE variable (and -K command-line option). Ruby 2.0
will fix this, hopefully in a wonderful way (I'm talking total coverage,
i.e, strings, io, regexes, and so on), so that character set and
character encoding is handled as transparently as possible (i.e, we as
Ruby programmers don't have to lift a finger),
  nikolai

···

--
::: name: Nikolai Weibull :: aliases: pcp / lone-star / aka :::
::: born: Chicago, IL USA :: loc atm: Gothenburg, Sweden :::
::: page: www.pcppopper.org :: fun atm: gf,lps,ruby,lisp,war3 :::
main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}

Thank you, that is very helpfull.

best regards,

Brian

···

On Tue, 8 Mar 2005 01:57:37 +0900, Simon Strandgaard <neoneye@gmail.com> wrote:

On Mon, 7 Mar 2005 21:48:54 +0900, Nikolai Weibull > <mailing-lists.ruby-talk@rawuncut.elitemail.org> wrote:
[snip]
> You need ncursesw (configure --enable-widec).
>
> Check the archive (http://www.ruby-talk.org/\) for previous discussions
> (Simon Strandgaard has done some investigation into using it from Ruby).

I wrote a small .c wrapper for ncursesw.
See code here:
http://rubyforge.org/cgi-bin/viewcvs.cgi/*checkout*/projects/experimental/buffer2/source/tui.c?rev=1.4&cvsroot=aeditor

--
Simon Strandgaard

--
Brian Schröder
http://ruby.brian-schroeder.de/

Ahh. Is there an official guess on when 2.0 will happen? Best estimate I can
find is 2006-ish?

···

On Monday 07 March 2005 14:52, Nikolai Weibull wrote:

* Lee Braiden (Mar 07, 2005 14:40):
> What is the general state of unicode support in ruby?

Ruby 2.0
will fix this, hopefully in a wonderful way (I'm talking total coverage,

--
Lee.

I just wonder how is it possible that a language which originated in
Japan doesn't support unicode & co. out of the box. They do need unicode
for proper handling of their character sets, don't they? How is it
possible historically that noone cared about it?

Csaba

···

On Mon, Mar 07, 2005 at 11:52:35PM +0900, Nikolai Weibull wrote:

* Lee Braiden (Mar 07, 2005 14:40):
> What is the general state of unicode support in ruby?

There is none, beyond a very hackish one for regular expression

* Lee Braiden (Mar 07, 2005 16:10):

Ahh. Is there an official guess on when 2.0 will happen? Best
estimate I can find is 2006-ish?

That sounds like a wishful estimate. However, if I get the time (which
I won't), I'll probably hack something together as a suggestion for
Unicode support. matz has commented on some parts of the future
semantics of Strings, but there's still a lot to figure out, I'd say,
  nikolai

···

--
::: name: Nikolai Weibull :: aliases: pcp / lone-star / aka :::
::: born: Chicago, IL USA :: loc atm: Gothenburg, Sweden :::
::: page: www.pcppopper.org :: fun atm: gf,lps,ruby,lisp,war3 :::
main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}

No. Before Unicode there were already several different ways of
encoding Japanese text (just as we English speakers have had ASCII and
EBCDIC in the past), and Unicode is only one of them. Apparently
Unicode isn't even the dominant way of doing so just yet: the JIS
encodings seem to be more popular at the moment, and there are even
three variations of JIS (Shift-JIS is by far the most widely used for
Japanese web pages and such, and ISO-2022-JP is most widely used for
Japanese email, and Japanese locales on Unix/Linux use the JIS EUC
encoding).

See this site for more information on this complicated topic:

http://www.cs.mcgill.ca/~aelias4/encodings.html

···

On Wed, 9 Mar 2005 13:10:02 +0900, Cs. Henk <csaba-ml@beastie.creo.hu> wrote:

I just wonder how is it possible that a language which originated in
Japan doesn't support unicode & co. out of the box. They do need unicode
for proper handling of their character sets, don't they?

This is interesting, thanks for the pointer! But then, how are these
popular schemes supported by ruby? Isn't it possible/desirable to use a
generic scheme which can be realized then either as unicode or as one of
the above encodings?

Csaba

···

On Wed, Mar 09, 2005 at 01:45:57PM +0900, Dido Sevilla wrote:

No. Before Unicode there were already several different ways of
encoding Japanese text (just as we English speakers have had ASCII and
EBCDIC in the past), and Unicode is only one of them. Apparently
Unicode isn't even the dominant way of doing so just yet: the JIS
encodings seem to be more popular at the moment, and there are even
three variations of JIS (Shift-JIS is by far the most widely used for
Japanese web pages and such, and ISO-2022-JP is most widely used for
Japanese email, and Japanese locales on Unix/Linux use the JIS EUC
encoding).

See this site for more information on this complicated topic:

http://www.cs.mcgill.ca/~aelias4/encodings.html

Hi,

···

In message "Re: ncurses ruby and utf-8" on Thu, 10 Mar 2005 08:46:50 +0900, "Cs. Henk" <csaba-ml@beastie.creo.hu> writes:

This is interesting, thanks for the pointer! But then, how are these
popular schemes supported by ruby? Isn't it possible/desirable to use a
generic scheme which can be realized then either as unicode or as one of
the above encodings?

Ruby Regexp can handle these encodings (i.e. EUC-JP, Shift_JIS, UTF-8).

              matz.