[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

insstr (from ncursesw) UTF-8 issue

From: Ciprian Dorin, Craciun
Subject: insstr (from ncursesw) UTF-8 issue
Date: Mon, 7 Sep 2009 17:19:40 +0300

    Hello all!

    I've discovered a problem (I think it's a bug, but maybe I'm doing
something wrong) about the behavior of the insstr procedure in the
context of UTF-8 encodings. (I'm using the ncursesw library.)

    To keep the email short, I've attached a tar file that contains
all the necessary code to reproduce the bug. (Both a Python version
(from which I've started) and a C version.)
    * context.txt contains the current versions of ncursesw library,
and the result of the linking of my application;
    * bug.c and bug.py contain the sourcecode;
    * bug.c.bash and bug.py.bash the commands used to run the code;

    In summary the following code does not work correctly:
        mvinsstr (4, 0, "|aaist|"); // the correct expected order
(without special characters)
        mvinsstr (5, 0, "|\xc4\x83\xc3\xa2\xc3\xae\xc5\x9f\xc5\xa3|");
// the wrong order (with special characters)

    It should print the characters |ăâîşţ| (some Romanian diacritics)
(as in |aaist|), but instead it prints ||ţşîâă. It seems it sorts the
characters... Now the addstr works as expected.

    Any problems on my side? Any solutions?

    Ciprian Craciun.

Attachment: bug.tar
Description: Unix tar archive

reply via email to

[Prev in Thread] Current Thread [Next in Thread]