lkml.org 
[lkml]   [2006]   [Feb]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH]console:UTF-8 mode compatibility fixes
Adam Tla/lka <atlka@pg.gda.pl> wrote:
>
>
> This patch applies to 2.6.15.3 kernel sources to drivers/char/vt.c file.
> It should work with other versions too.
>
> Changed console behaviour so in UTF-8 mode vt100 alternate character
> sequences work as described in terminfo/termcap linux terminal definition.
> Programs can use vt100 control seqences - smacs, rmacs and acsc characters
> in UTF-8 mode in the same way as in normal mode so one definition is always
> valid - current behaviour make these seqences not working in UTF-8 mode.
>
> Added reporting malformed UTF-8 seqences as replacement glyphs.
> I think that terminal should always display something rather then ignoring
> these kind of data as it does now. Also it sticks to Unicode standards
> saying that every wrong byte should be reported. It is more human readable
> too in case of Latin subsets including ASCII chars.
>
> ...
>
> - } else if (vc->vc_utf) {
> + } else if (vc->vc_utf && !vc->vc_disp_ctrl) {
> /* Combine UTF-8 into Unicode */
> - /* Incomplete characters silently ignored */
> + /* Malformed sequence represented as replacement glyphs */
> +rescan_last_byte:
> if(c > 0x7f) {
>
> ...
>
> + if (vc->vc_npar) {
> + c = orig;
> + goto rescan_last_byte;
> + }
>
> ...
>
> + }
> + vc->vc_utf_count = 0;
> + c = orig;
> + goto rescan_last_byte;
> + }
> continue;
> }

I spent some time trying to work out why this cannot cause an infinite loop
and gave up. Can you explain?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-02-18 12:03    [W:1.412 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site