Bug 519311 - The Chinese wide char could not showed accurately when the ncurses Window is refresehd
Summary: The Chinese wide char could not showed accurately when the ncurses Window is ...
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: ncurses
Version: 4.8
Hardware: All
OS: Linux
Target Milestone: rc
: ---
Assignee: Miroslav Lichvar
QA Contact: BaseOS QE
Depends On:
TreeView+ depends on / blocked
Reported: 2009-08-26 02:09 UTC by Qianfeng Zhang
Modified: 2018-10-27 14:50 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 519376 (view as bug list)
Last Closed: 2010-03-18 16:29:54 UTC

Attachments (Terms of Use)
Testing code (746 bytes, text/x-csrc)
2009-08-26 02:11 UTC, Qianfeng Zhang
no flags Details
patch for ncurses-5.4-15/RHEL4.7 (367 bytes, patch)
2009-08-26 02:16 UTC, Qianfeng Zhang
no flags Details | Diff
patch for ncurses-5.5-26/RHEL5.3 (375 bytes, patch)
2009-08-26 02:17 UTC, Qianfeng Zhang
no flags Details | Diff
fix for refresh of window on top of multi-column characters (19.35 KB, patch)
2009-08-27 16:18 UTC, Miroslav Lichvar
no flags Details | Diff

Description Qianfeng Zhang 2009-08-26 02:09:33 UTC
See that attached testC.c file.   Compiled with "#> gcc -o testC testC.c -lncursesw"  

With the codes,  the second ncurses window  "pWin1" will exactly cover the righ half of the second Chinese word in the string. But after popping up "pWin1",  the 
"wnoutrefresh(pWin)" and "doupdate()"  could not recover the content of string correctly. 

I have checked the codes and made a patch to fix the issue.  Here attached the patches for both  ncurses-5.4-15/RHEL4.8 and ncurses-5.5.26/RHEL5.3.

The point with the patching is that: 

     In  doupdate()/TransformLine(),  we have to re-print the whole wide char even though only half of the char was covered, cause the codes in PutAttrChar() always ignore the extended half of the wide char (and not print it to the stdout) ;  and some terminal (eg. gnome-terminal) could not redraw the Wide Char if not the whole bytes of it were received from the pipe each time.

Comment 1 Qianfeng Zhang 2009-08-26 02:11:21 UTC
Created attachment 358657 [details]
Testing code

Comment 2 Qianfeng Zhang 2009-08-26 02:16:18 UTC
Created attachment 358658 [details]
patch for  ncurses-5.4-15/RHEL4.7

Comment 3 Qianfeng Zhang 2009-08-26 02:17:09 UTC
Created attachment 358659 [details]
patch for ncurses-5.5-26/RHEL5.3

Comment 4 Miroslav Lichvar 2009-08-26 10:51:12 UTC
This seems to be fixed in upstream patches 20070630 and 20070707:

       + improve fix for refresh of window on top of multi-column characters,
         taking into account some split characters on left/right window

       + partial fix for refresh of window on top of multi-column characters
         which are partly overwritten (report by Sadrul H Chowdhury).

Comment 5 Qianfeng Zhang 2009-08-26 14:10:31 UTC
I think that fixes are for different situation,  the issue reported here occurred with both ncurses-5.4-15 and ncurses-5.5-26,  I think which are latest version for RHEL4 and RHEL5.  Would you please run a test with my attached codes ?

Comment 6 Miroslav Lichvar 2009-08-26 14:20:57 UTC
I run the test and the patches seem to fix it. But I tried it only on RHEL5 (bug #519376), backporting for ncurses-5.4 will be a bit harder.

Comment 7 Miroslav Lichvar 2009-08-27 16:18:38 UTC
Created attachment 358903 [details]
fix for refresh of window on top of multi-column characters

Comment 8 Qianfeng Zhang 2009-10-23 06:36:38 UTC
When will the issue be fixed on RHEL 4.x ?  Can you just use my fixing patch for RHEL 4.7?  I have tested it. This should work for RHEL 4.x.

Comment 9 Ondrej Vasik 2010-03-18 16:29:54 UTC
As RHEL-4.9 is last update for RHEL-4 and it is not suitable for new features
and should address only security, performance and critical issues, I'm closing
that bugzilla WONTFIX. 

Note - https://bugzilla.redhat.com/show_bug.cgi?id=519376 is opened bugzilla for RHEL-5.

Note You need to log in before you can comment on or make changes to this bug.