On Sun, 2008-12-21 at 23:44 +0900, Tanaka Akira wrote:
> In article <1229799814.1206.4.camel / sparkster>,
>   "xRaich[o]2x" <raichoo / googlemail.com> writes:
> 
> > I just wrote a little patch for rub 1.9.1-preview2 so it compiles under
> > the recent opensolaris release. I don't know if this is any good since
> > it's just a quick hack. Would be cool if someone could review this.
> 
> ISPRINT is locale insensitive.
> isprint is locale sensitive, I guess.

i extended the patch a little bit. This one should be better.

--- ext/curses/curses.c	Tue Nov 11 12:00:39 2008
+++ ext/curses/curses.c	Sun Dec 21 17:00:44 2008
@@ -410,6 +410,9 @@
 static VALUE
 curses_getch(VALUE obj)
 {
+#if defined(__sun)
+	eucwidth_t wp;
+#endif
     int c;
 
     rb_read_check(stdin);
@@ -416,7 +419,12 @@
     curses_stdscr();
     c = getch();
     if (c == EOF) return Qnil;
+#if defined( __sun)
+	getwidth(&wp);
+    if (ISPRINT(c, wp)) {
+#else
     if (ISPRINT(c)) {
+#endif
 	char ch = (char)c;
 
 	return rb_locale_str_new(&ch, 1);
@@ -1105,12 +1113,20 @@
 {
     struct windata *winp;
     int c;
+#if defined(__sun)
+	eucwidth_t wp;
+#endif
 
     rb_read_check(stdin);
     GetWINDOW(obj, winp);
     c = wgetch(winp->window);
     if (c == EOF) return Qnil;
+#if defined(__sun)
+	getwidth(&wp);
+    if (ISPRINT(c, wp)) {
+#else
     if (ISPRINT(c)) {
+#endif
 	char ch = (char)c;
 
 	return rb_locale_str_new(&ch, 1);

Regards,
Björn