[Top][All Lists]

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

Re: insstr (from ncursesw) UTF-8 issue

From: Thomas Dickey
Subject: Re: insstr (from ncursesw) UTF-8 issue
Date: Mon, 7 Sep 2009 20:49:39 -0400 (EDT)

On Mon, 7 Sep 2009, Ciprian Dorin, Craciun wrote:

   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.

Offhand, it looks like a bug in ncurses - I'll check/see what the fix would be...

(ins_wstr and related functions should work, though they're more cumbersome to use).

Thomas E. Dickey

reply via email to

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