Skip to content

Inconsistency between tr and cut on multibyte character #7600

@jyte

Description

@jyte

Hi,

I downloaded the last release and have a strange behaviour.

I have the following test.txt file (utf8 encoded)

zone1§zone2§zone3
$ ./coreutils cut -d§ -f2 test.txt
zone2
$ cat test.txt | ./coreutils tr '§' ';'
zone1;;zone2;;zone3

the cut command behave as I would expect (although the output is different from the gnu cut)
However, tr should not double ;

Basically, it seems to work fine when tr replace n byte(s) character by another n byte(s) character, but is broken if I try to replace a n byte(s) character by a m byte(s) character.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions