Bug 116758

Summary: utf8 encoding broken. multibyte char render ok,
Product: [Applications] konsole Reporter: atom <gazman>
Component: generalAssignee: Konsole Developer <konsole-devel>
Status: RESOLVED WORKSFORME    
Severity: normal CC: esigra
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:

Description atom 2005-11-20 13:03:41 UTC
Version:            (using KDE KDE 3.4.3)
Compiler:          gcc-i686-pc-linux-gnu 3.4.4 
OS:                Linux

When I enter multibyte characters (my language otherwise uses ISO8859-2, but utf8 is preferred), the display works ok. 
But when I delete them with backspace or delete, or move up and down the line with arrowkeys, the cursor eats into the prompt, because konsole doesn't recognise the multibyte char as one, but instead as two characters. 
This also means the line wraps in the middle of the actual space (I expect that the counter counts bytes and not characters).
That is also the reason for the previous scenario.


A simple char-detection code fragment would be (good for utf8...):
if (first_bit == 1) { 
   /* we have a multibyte char fragment */
   if (second_bit == 1) { 
      /* first byte of a multibyte character, the next (leading 1s - 1) bytes are a part of it too */
   } else {
      /* a data byte of a multibyte character. Search backwards in line to obtain character bytelength */
   }
}
So you don't have to look it up, in case you didn't know.
Comment 1 atom 2005-11-20 13:15:27 UTC
Duplicate of bug 116741.