It seems that a UTF-8 locale is causing Illegal byte sequence
.
Instead say:
LC_CTYPE=C your_command
man locale
says:
These environment variables affect each locale categories for all locale-aware programs: LC_CTYPE Character classification and case conversion.