GNU bug report logs -
#12192
multibyte: tr: TR operates on bytes, not characters
Previous Next
Full log
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Hi gnu folks,
as already known, tr cannot handle multibyte-encodings like utf-8:
> mst <at> eddie:~$ echo "foo" | tr o ö
> fÃÃ
i know, that multibyte encoding support is not needed for
posix-compilance, BUT:
the manpage of tr says the following:
> Translate, squeeze, and/or delete characters from standard input,
> writing to standard output.
and thats the inconsistence imho.
The typical interpretation of "character" in such a context means one
character on display. regardless which encoding is used or how many
bytes are used to display this. So, if tr realy translates "characters"
it should preserve the encoding. If it doesn't do, it does not
translate "characters" but "bytes". So there I see two ways:
- add multybyte-encoding support to tr
or
- change the manpage and helptext to not say "characters" but "bytes"
since it doesn't seem that somebody want to add the support to tr, an
update of the manpage would be the easier way to ensure the consistence.
Kind regards,
Michael
This bug report was last modified 6 years and 249 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.