Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Unicode Support?

Help
TandonMiir
2009-09-02
2013-04-26
  • TandonMiir
    TandonMiir
    2009-09-02

    Running Ubuntu 9.04 32-bit.

    I have been working on an application under Windows and have been doing quite well, however, when I began testing my solution under Ubuntu, I noticed my special characters were not displaying the same.

    I had been using the decimal representation of the unicode character (think 9608 == \u2588) and this approach worked when using a window .Add(rol, col, value) call.

    However, this produces an ASCII character on Ubuntu.

    My locale and encoding are correct, and I am able to use Python's curses wrapper to properly output unicode to the same terminal.

    Even further, I can output a unicode character within Mono, using Console.WriteLine(), and then attempt to write the same character through CursesSharp, which results in an ASCII character instead.

    I attempted to rebuild your libCursesWrapper with a -lncursesw instead of -lncurses, however, I get the same results.

    Any thoughts or suggestions?

     
    • At this time, CursesSharp does not support Unicode characters in a cross-platform fashion. As you have noticed, Unicode characters are displayed correctly on 32-bit Windows. It might also work on 64-bit Windows, though I wouldn't rely on that. This is because Unicode routines of underlying ncurses library are used only as an optimization on certain platforms, i.e. 32-bit Windows.

      Future versions of CursesSharp will include proper Unicode support, but it's going to take some time, as it's not a trivial task and I've been preoccupied lately with other projects.

      As for now, you could use Unicode characters and stick to Windows platforms, or print only ASCII characters, which will work on all supported platforms.

       
  • TandonMiir
    TandonMiir
    2009-10-02

    I can confirm it does work on x64 Vista, so that's good news. :)

    Keep up the good work!!

     
  • That is really good news :)

    I've been having some free time lately, so I started working on the project again. Since anything is better than writing documentation, I decided to concentrate on making unicode input/output cross-platform.

    In the latest SVN revision (107) national and special characters in unicode strings should be printable on all of the supported platforms (Windows, Linux, FreeBSD). This code is early-stage, though, so expect some occasional exception or maybe even a crash ;)

    Now I will do my best to make Curses Sharp fully unicode-aware and to stabilize the code and repair any bugs reported. All testers are welcome :)

     
  • TandonMiir
    TandonMiir
    2009-11-03

    Thanks so much for getting back to this!

    I pulled down the latest SVN as of right now (118) and tried to setup curses-sharp on Ubuntu 9.04 and Vista x64.

    Ubuntu 9.04

    Installed fairly easily. Following the instructions on  worked, only needed to troubleshoot a couple small issues:

    I didn't have autoconf installed, so I resolved that by executing

        sudo apt-get install autoconf autoconf-archive gnu-standards autoconf-doc libtool

    That may be overkill, but it got things moving.
    The next problem was with the bootstrapper step. m4 required an empty m4 directory to produce the configuration script. Easy enough

        mkdir m4

    That worked. Followed the rest of your steps, did a make, fired up Monodevelop, referenced the CursesSharp.dll file and ran in an external console and saw the scrolling UnicodeTest!

    Vista x64

    Vista, running Visual Studio 2008, I ran into trouble building the CursesWrapper project. I'm not sure if you had implemented this yet. Just reporting my efforts.

        Error 273 fatal error C1083: Cannot open include file: 'iconv.h': No such file or directory c:\curses-sharp-0.8\curseswrapper\unicode.c

    I poked around Google for a bit and tried to figure out how to get libiconv installed on Windows. I gave up after a bit and moved on to Ubuntu.

    The second error was in xbuffer.h, and is either a syntax error or an error triggered by the error above. There were lots, simply repeated, here's the first, distinct set:

        Error 1 error C2054: expected '(' to follow 'inline' c:\curses-sharp-0.8\curseswrapper\xbuffer.h     Line 53
        Error 2 error C2085: 'xbuf_len' : not in formal parameter list c:\curses-sharp-0.8\curseswrapper\xbuffer.h     Line 54
        Error 3 error C2143: syntax error : missing ';' before '{' c:\curses-sharp-0.8\curseswrapper\xbuffer.h     Line 54

    I'll be continuing my project development on my Ubuntu box. Thanks again for your work, I'm happy to test it out at any time.

      : http://curses-sharp.sourceforge.net/index.php?page=linux

     
  • It's good to know my efforts are appreciated :-)

    My current goal is to make CursesSharp buildable on Windows, Linux, FreeBSD and OpenSolaris. I work on one platform at a time and usually when I fix or add a feature on one, something breaks on others. As a result, many SVN revisions are only partially usable, i.e. they might give compilation errors on some platforms. Lately I've been concentrating on Unix-like systems, so it doesn't surprise me that the Windows port is broken :-)

    In revision 119 I added the missing m4 directory and fixed some warnings. It should compile cleanly in Linux. You might want to try the configure option "-enable-debug" which will turn on internal sanity checks and make libcurseswrapper.so link to ncurses library with debugging symbols. These checks are important for discovering possible bugs in CursesSharp.

    Now I'll focus on repairing the Windows port. It should take no longer than a day or two. Libiconv is not needed, so you don't have to worry about that. Also, currently Unicode is supported only in string-oriented functions. Single character I/O is still TBD and it might take another few days.