skogsbaer / hscurses

ncurses binding for Haskell
http://hackage.haskell.org/package/hscurses
GNU Lesser General Public License v2.1
61 stars 21 forks source link

hscurses doesn't handle wide characters on OS X #14

Closed sixohsix closed 12 years ago

sixohsix commented 12 years ago

I'm trying to get unicode characters to display in an application using hscurses on OS X, and I can't get it to work.

As a test case I downloaded hscurses-fish-ex and verified that it works fine. I also verified that my terminal can display unicode characters (eg, on the ghci command line I can create unicode strings and display them).

However, when I modify the fish program and put some unicode characters into the fish, those characters display as spaces or are not rendered at all.

My theory is that hscurses doesn't believe OS X has ncursesw support. There is no ncursesw/ncurses.h in the include dirs. The man page for add_wch claims that the function should be found in regular #include <ncurses.h>. The function appears in /usr/lib/ncurses.h.

As well there is not libncursesw library file, just libncurses.5.4.dylib.

I don't know enough about autoconf to know if this theory is right, but I am certain that unicode characters just won't display on OS X with hscurses. Do you have any suggestions of what else I could try?

sixohsix commented 12 years ago

Okay... nevermind the above. Further digging suggests that only wAddStr supports wide characters. If I use that it seems to work.

There are no wide character single-char output functions, nor wide-character input functions. Is that correct?

skogsbaer commented 12 years ago

Currently, there is only wAddStr, that's right. I would be happy to accept a patch with support for add_wch, hower ;-)

skogsbaer commented 12 years ago

Ok, closing this issue because I think using wAddStr is an acceptable solution for having wide characters.