On Mon, 19 Nov 2012 23:40:29 +0100 Roland Mainz wrote:
> Oracle's Solaris PIT hit an issue in ast-ksh.2012-10-24 (it may be
> much older) with typeset -L variables and multibyte characters which
> are wider than one terminal cell (the example is for SuSE 12.2/Linux
> on AMD64 in the en_US.UTF-8 locale).
> -- snip --
> $ LC_ALL=en_US.UTF-8 ~/bin/ksh -c 'typeset -L2 l ; l="x$(printf
> "\u[5154]")x" ; print "$l"'
> x?
> -- snip --
> The problem is that '?' marks a single byte which appears to be an
> invalid multibyte character sequence in this context.
> Looking at a hex dump confirms his:
> -- snip --
> $ LC_ALL=en_US.UTF-8 ~/bin/ksh -c 'typeset -L2 l ; l="x$(printf
> "\u[5154]")x" ; print "$l"' | od -t x1
> 0000000 78 e5 0a
> 0000003
> -- snip --
> Testcase using AST "wc":
> -- snip --
> $ LC_ALL=en_US.UTF-8 ~/bin/ksh -c 'typeset -L2 l ; l="x$(printf
> "\u[5154]")x" ; print "${l}X"' | ~/bin/ksh -c 'builtin wc ; wc -C'
> wc: warning: invalid multibyte character
> 2
> -- snip --
in the last case the second ~/bin/ksh also needs an LC_ALL=en_US.UTF-8
_______________________________________________
ast-developers mailing list
[email protected]
http://lists.research.att.com/mailman/listinfo/ast-developers