Weird bug? Piping text to cat alters it (bash works fine)

13 views
Skip to first unread message

Nick Demou

unread,
Jan 12, 2018, 8:00:43 AM1/12/18
to xonsh
This is really weird:

$ echo αβγδ | cat   # αβγδ are Greek letters
αβγδ # SAY WHAT???
$ bash -c 'echo αβγδ | cat'
αβγδ     # AS EXPECTED

Of course I'm not piping texts to cat but the same happens when cating files with Greek text.

FWIW using hexdump I see it gets different bytes when cat is involved:

$ echo αβγδ | hexdump -C
00000000  ce b1 ce b2 ce b3 ce b4  0a                       |.........|
00000009
$ echo αβγδ | cat | hexdump -C
00000000  c3 8e c2 b1 c3 8e c2 b2  c3 8e c2 b3 c3 8e c2 b4  |................|
00000010  0a                                                |.|
00000011



Nick Demou

unread,
Jan 14, 2018, 3:27:04 AM1/14/18
to xonsh
I'm about to switch laptops so I tested on the new one and everything worked just fine. I'll leave it at that since on my old laptop I've gone wild with pip and pip3 and it has become a mess.

 
Τη Παρασκευή, 12 Ιανουαρίου 2018 - 3:00:43 μ.μ. UTC+2, ο χρήστης Nick Demou έγραψε:
This is really weird:

$ echo αβγδ | cat   # αβγδ are Greek letters
αβγδ # SAY WHAT???
$ bash -c 'echo αβγδ | cat'
αβγδ     # AS EXPECTED

[...]


Reply all
Reply to author
Forward
0 new messages