Current-Users archive

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

Re: sh command bogus output in UTF-8 text (Chavdar Ivanov) writes:

>On Thu, 6 Feb 2020 at 06:36, Jun Ebihara <> wrote:
>> sh seems broken,e3-81-ab -> e3-81-81-ab
>> amibase: {54} sh sh-command-utf8-testing | od -ax
>> 0000000   sp  sp  e3  81  81  ab  nl
>>    2020    81e3    ab81    000a
>> 0000007

sh in netbsd-8 seems to be fine. It also works if you use a quoted
here document (cat << 'EOF').

The shell isn't really 8-bit clean, internally the parser uses control
characters with byte values 129..139 that are supposed to be escaped
on input. The byte 0x81 (129) in the above UTF-8 sequence triggers 
the bug.

>$ ksh bg-testing
>ã?« киÑ?илиÑ?а

Again one of the control bytes on input.

                                Michael van Elst
                                "A potential Snark may lurk in every tree."

Home | Main Index | Thread Index | Old Index