I need to be able to paste binary data into a terminal. For some reason, every byte outside the ASCII range (0x80-0xff) is pasted as the same three byte sequence 0xef 0xbf 0xbd.
For example:
$ echo -en "\x80" | xclip
$ hd
<paste><EOF>
00000000 ef bf bd |...|
00000004
It has something to do with the character encoding used by the terminal since if I change it from UTF-8 to ISO 8859 or similar every character in the extended range is translated to 0x3f.
Does anybody have an idea on how to paste arbitrary binary data into the terminal?
Edit: This seems to be very terminal dependent. The example above is in Konsole. I get the desired behavior in xterm and Gnome Terminal doesn't allow to paste characters in the extended range at all. Any Konsole specific solution would still be appreciated.