Re: [PATCH]console:UTF-8 mode compatibility fixes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Adam Tla/lka <[email protected]> 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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux