• Egmont Koblinger's avatar
    console UTF-8 fixes (fix) · 1ed8a2b3
    Egmont Koblinger authored
    Recently my console UTF-8 patch went mainline.  Here is an additional patch
    that fixes two nasty issues and improves a third one, namely:
    
    1. My patch changed the behavior if a glyph is not found in the Unicode
       mapping table. Previously for Unicode values less than 256 or 512 the
       kernel tried to display the glyph from that position of the glyph table,
       which could lead to a different accented letter being displayed. I
       removed this fallback possibility and changed it to display the
       replacement symbol.
    
       As Behdad pointed out, some fonts (e.g. sun12x22 from the kbd package)
       lack Unicode mapping information, hence all you get is lots of question
       marks. Though theoretically it's actually a user-space bug (the font
       should be fixed), Behdad and I both believe that it'd be good to work
       around in the kernel by re-introducing the fallback solution for ASCII
       characters only. This sounds a quite reasonable decision, since all fonts
       ship the ASCII characters in the first 128 positions. This way users
       won't be surprised by lots of question marks just because s/he issued a
       not-so-perfectly parameterized setfont command. As this fallback is only
       re-introduced for code points below 128, you still won't see an accented
       letter replaced by another, but at least you'll always get the English
       letters right.
    
    2. My patch introduced "question mark with inverted color attributes" as a
       last resort fallback glyph. Though it perfectly works on VGA console, on
       framebuffer you may end up with question marks that are highlighed but
       shouldn't be, and normal characters that are accidentally highlighed.
       This is caused by missing FLUSHes when changing the color attribute.
    
    3. I've updated the table of double-width character based on Markus's
       updated version. Only ten new code poings (one interval) is added.
    Signed-off-by: default avatarEgmont Koblinger <egmont@uhulinux.hu>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    1ed8a2b3
vt.c 94.5 KB