Bug 519311

Summary: The Chinese wide char could not showed accurately when the ncurses Window is refresehd
Product: Red Hat Enterprise Linux 4 Reporter: Qianfeng Zhang <frzhang>
Component: ncursesAssignee: Miroslav Lichvar <mlichvar>
Status: CLOSED WONTFIX QA Contact: BaseOS QE <qe-baseos-auto>
Severity: urgent Docs Contact:
Priority: high    
Version: 4.8CC: ovasik, tao
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 519376 (view as bug list) Environment:
Last Closed: 2010-03-18 16:29:54 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Testing code
none
patch for ncurses-5.4-15/RHEL4.7
none
patch for ncurses-5.5-26/RHEL5.3
none
fix for refresh of window on top of multi-column characters none

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:

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

20070630
       + 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.