-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pipe image into bat gives stream did not contain valid UTF-8
#150
Comments
[bat error]: stream did not contain valid UTF-8
stream did not contain valid UTF-8
Binary data is currently not handled properly in I currently think the best way to proceed here would be to:
What do you think? |
Yeah, that makes sense. Sorta matches what httpie does: https://github.com/jakubroztocil/httpie/blob/master/README.rst#binary-data |
In order to start with this, I have created this small Rust library: |
Use a loop-through mode that simply copies input to output if a non-interactive terminal is detected. see #150
After some major refactorings, I was able to implement the first part (pipe through binary data 1:1) in 226d9a5. So this works now:
The second part (detecting binary files in interactive mode) should be easy to implement with the |
I'm going to close this ticket as the reported bug has been fixed. I will open a new ticket that tracks the second part. |
Sounds good! For prosperity, see #248 |
cat myimage.png | base64
works a treat. Usingbat
instead errors with[bat error]: stream did not contain valid UTF-8
The text was updated successfully, but these errors were encountered: