bug-ncurses
[Top][All Lists]
Advanced

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

Re: form_driver and wide-char


From: Brian Tan
Subject: Re: form_driver and wide-char
Date: Thu, 07 Dec 2006 11:24:41 -0500
User-agent: Thunderbird 1.5.0.8 (X11/20061107)

limited success with form_driver() and mbs using getch. Some chars went through correctly into field buffer, while others get clobbered. However, screen update is always garbled. Attached sample program and test data.

# export LANG=en_US.UTF-8
# gcc -O2 -g testform.c -o testform -lncursesw -lformw
# testform <testform.txt

Char that went through: 好 e5a5bd
Char went bad: 陈 e99988

Also field buffer advanced incorrectly after widechar. (gap between '好' and 'a')

Thomas Dickey wrote:

1. field_buffer(); it does not return mbs correctly. For example, wchar 0x597d -> mbs e5a5bd written with set_field_buffer(), screen form updates and shows “好 " (with trailing space due to strlen=3, I think) but field_buffer() returns c3a5c2a5c2bd, making further wchar entry not possible, unless I keep track of field buffer independently.

This is probably the best place to focus on right now.
The two (I think) are independent

2. form_driver; for not accepting wchar or mbs :)

It's supposed to do the latter - but it's likely that you're better able to see problems. I tested it by select/paste from the UTF-8 scripts in
the dialog package, combined with editing from the keyboard.  At the same
time, my test program would set/get from the field buffer, so I could see mismatches.

So - going back to testing this area, along with some sample data (and locale information from you) would help to reproduce the problem and focus on what's going wrong.

thanks



--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

Attachment: testform.tar.gz
Description: GNU Zip compressed data


reply via email to

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