Bug 116758 - utf8 encoding broken. multibyte char render ok,
Summary: utf8 encoding broken. multibyte char render ok,
Status: RESOLVED WORKSFORME
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-20 13:03 UTC by atom
Modified: 2008-05-06 16:31 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

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