Bug 131938

Summary: unicode - wrong char at end of block
Product: [Applications] konsole Reporter: Kurt Hindenburg <khindenburg>
Component: generalAssignee: Konsole Developer <konsole-devel>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: sh script to display incorrect output
Patch to fix this

Description Kurt Hindenburg 2006-08-06 06:28:38 UTC
Version:            (using KDE KDE 3.5.4)
Installed from:    Compiled From Sources
OS:                Linux

Email: Jonas Hurrelmann <j@outpo.st>

the latest konsole has a bug decoding UTF-8 (introduced with the "speedup"  patch).
When checking for the next control code in TEmulation::onRcvBlock the loop runs until len but as the toUnicode call uses one additionally char it faces a 0 at the end causing a wrong character at the end of each block.
Comment 1 Kurt Hindenburg 2006-08-06 06:29:28 UTC
Created attachment 17243 [details]
sh script to display incorrect output
Comment 2 Kurt Hindenburg 2006-08-06 06:30:36 UTC
Created attachment 17244 [details]
Patch to fix this
Comment 3 Kurt Hindenburg 2006-08-06 06:32:51 UTC
SVN commit 570191 by hindenburg:

Fix incorrect unicode char at end of block.  Thanks Jonas Hurrelmann for
email and patch.

BUG:131938


 M  +1 -1      TEmulation.cpp  


--- branches/KDE/3.5/kdebase/konsole/konsole/TEmulation.cpp #570190:570191
@@ -325,7 +325,7 @@
     }
 
     // Otherwise, bulk decode until the next control code
-    for(l = i; l < len; ++l)
+    for(l = i; l < len-1; ++l)
       if ((unsigned char) s[l] < 32)
          break;
 
Comment 4 Kurt Hindenburg 2006-08-06 06:36:42 UTC
Not needed for KDE4 since this code is no longer used.