tr(1) and LANG=de_DE.UTF-8

RW rwmaillists at googlemail.com
Thu Oct 29 13:00:50 UTC 2015


On Thu, 29 Oct 2015 11:31:33 +0100
Matthias Apitz wrote:

> Hello,
> 
> I was wondering why I could not patch a byte \357 in a file with
> tr(1):
> 
...
> [guru at kant-r269739 ~]$ LANG=de_DE.UTF-8
> tr '\357' '\000' < /tmp/x  | od -c
...
> until I changed the LANG to C:

In UTF-8 a byte containing \357 can only exist as part of a multibyte
character. Presumably tr interprets \357 as a character rather than a
byte.


More information about the freebsd-questions mailing list