Hi наб,
As far as I know, this tool works with text input, as most Unix tools.
What you introduced is not a text file, per POSIX.1-2024, Volume 1,
Chapter 3, definition 3.387:
3.387 Text File
A file that contains characters organized into zero or more
lines. The lines do not contain NUL characters and none can
exceed {LINE_MAX} bytes in length, including the <newline>
character. Although POSIX.1-2024 does not distinguish between
text files and binary files (see the ISO C standard), many
utilities only produce predictable or meaningful output when
operating on text files. The standard utilities that have such
restrictions always specify "text files" in their STDIN or INPUT
FILES sections.
You could say it's a binary file, although POSIX claims to not
differentiate between text files and binary files (but they do), but
let's agree that a binary file is what POSIX doesn't consider a text
file. What you're experiencing is "[non] predictable [nor] meaningful
output", in standardese, a.k.a., undefined behavior, I'd say.
Have a lovely New Year!
Alex