[Konsole-devel] [Bug 116758] New: utf8 encoding broken. multibyte char render ok,

atom gazman at email.si
Sun Nov 20 12:03:41 UTC 2005


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=116758         
           Summary: utf8 encoding broken. multibyte char render ok,
           Product: konsole
           Version: unspecified
          Platform: unspecified
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: general
        AssignedTo: konsole-devel kde org
        ReportedBy: gazman email si


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.



More information about the konsole-devel mailing list