Subject: bug#10880: instead of characters, tr works on bytes

From: Eric Blake <[email-masked]>
Date: Fri, 24 Feb 2012 20:28:41 -0700

On 02/24/2012 07:29 AM, Marton Kadar wrote:
> Don't know which is the official way to report a bug in 'tr'
> so I will copy to this list too. CC me on replies as I am not
> subscribing.

Sending mail to [email-masked] _is_ what creates a bug on
debbugs.gnu.org, so you have managed to create a duplicate.  Paul Eggert
has already merged 9365, 10880, and 9569, so now, replying to any one of
those three is merely adding information to the same report.

>>
>> Let us try to delete a character and see if it worked:
>>
>> $ echo árvíz | tr -d á | od -c
>> 0000000   r   v 255   z  \n
>> 0000005

Please keep in mind that upstream coreutils is not yet converted over to
multibyte support.  This is evidence of one of the places that multibyte
support is required, and therefore, where you cannot expect things to
work yet.  No one has yet contributed a maintainable patch that does not
penalize single-byte locales, at least not upstream.  Several distros
have their own UTF-8 patches that they apply, but then, this would be a
bug you report to your distro and not upstream.

>> I'll check the source for tr myself although never coded in C.
>> This should be a trivial fix.

Alas, dealing with multibyte characters without penalizing single-byte
locales is NOT trivial, or it would have been done long ago.

-- 
Eric Blake   [email-masked]    +1-919-301-3266
Libvirt virtualization library http://libvirt.org