Bug 131938 - unicode - wrong char at end of block
Summary: unicode - wrong char at end of block
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-06 06:28 UTC by Kurt Hindenburg
Modified: 2006-08-06 06:36 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
sh script to display incorrect output (138 bytes, text/plain)
2006-08-06 06:29 UTC, Kurt Hindenburg
Details
Patch to fix this (368 bytes, patch)
2006-08-06 06:30 UTC, Kurt Hindenburg
Details

Note You need to log in before you can comment on or make changes to this bug.
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.