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.