Skip to content
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

Strange "Invalid UTF-8" output when an input file is attached #3

Open
midn1 opened this issue Jul 8, 2022 · 0 comments
Open

Strange "Invalid UTF-8" output when an input file is attached #3

midn1 opened this issue Jul 8, 2022 · 0 comments

Comments

@midn1
Copy link

midn1 commented Jul 8, 2022

I'm trying to feed in binary data through the terminal and am expecting binary data in return. Apparently setting any input file, whether /dev/stdin or the source file itself, makes something along the way expect UTF-8 text. That something then spams [Invalid UTF-8] for each wrong byte. This cannot be the terminal I'm running, since it occurs when redirecting the output to a file, too. I admit it's a strange use case, but so is Brainfuck in the first place.

Minimal reproducible example under Debian Bullseye:

test.bf:

    -[.-]

In terminal:

$ beef test.bf 
��������������������������������������������������������������������������������������������������������������������������������~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPONMLKJIHGFEDCBA@?>=<;:9876543210/.-,+*)('&%$#"! �


       
$ beef -i test.bf test.bf 
[Invalid UTF-8] \xff[Invalid UTF-8] \xfe[Invalid UTF-8] \xfd[Invalid UTF-8] \xfc[Invalid UTF-8] \xfb[Invalid UTF-8] \xfa[Invalid UTF-8] \xf9[Invalid UTF-8] \xf8[Invalid UTF-8] \xf7[Invalid UTF-8] \xf6[Invalid UTF-8] \xf5[Invalid UTF-8] \xf4[Invalid UTF-8] \xf3[Invalid UTF-8] \xf2[Invalid UTF-8] \xf1[Invalid UTF-8] \xf0[Invalid UTF-8] \xef[Invalid UTF-8] \xee[Invalid UTF-8] \xed[Invalid UTF-8] \xec[Invalid UTF-8] \xeb[Invalid UTF-8] \xea[Invalid UTF-8] \xe9[Invalid UTF-8] \xe8[Invalid UTF-8] \xe7[Invalid UTF-8] \xe6[Invalid UTF-8] \xe5[Invalid UTF-8] \xe4[Invalid UTF-8] \xe3[Invalid UTF-8] \xe2[Invalid UTF-8] \xe1[Invalid UTF-8] \xe0[Invalid UTF-8] \xdf[Invalid UTF-8] \xde[Invalid UTF-8] \xdd[Invalid UTF-8] \xdc[Invalid UTF-8] \xdb[Invalid UTF-8] \xda[Invalid UTF-8] \xd9[Invalid UTF-8] \xd8[Invalid UTF-8] \xd7[Invalid UTF-8] \xd6[Invalid UTF-8] \xd5[Invalid UTF-8] \xd4[Invalid UTF-8] \xd3[Invalid UTF-8] \xd2[Invalid UTF-8] \xd1[Invalid UTF-8] \xd0[Invalid UTF-8] \xcf[Invalid UTF-8] \xce[Invalid UTF-8] \xcd[Invalid UTF-8] \xcc[Invalid UTF-8] \xcb[Invalid UTF-8] \xca[Invalid UTF-8] \xc9[Invalid UTF-8] \xc8[Invalid UTF-8] \xc7[Invalid UTF-8] \xc6[Invalid UTF-8] \xc5[Invalid UTF-8] \xc4[Invalid UTF-8] \xc3[Invalid UTF-8] \xc2[Invalid UTF-8] \xc1[Invalid UTF-8] \xc0[Invalid UTF-8] \xbf[Invalid UTF-8] \xbe[Invalid UTF-8] \xbd[Invalid UTF-8] \xbc[Invalid UTF-8] \xbb[Invalid UTF-8] \xba[Invalid UTF-8] \xb9[Invalid UTF-8] \xb8[Invalid UTF-8] \xb7[Invalid UTF-8] \xb6[Invalid UTF-8] \xb5[Invalid UTF-8] \xb4[Invalid UTF-8] \xb3[Invalid UTF-8] \xb2[Invalid UTF-8] \xb1[Invalid UTF-8] \xb0[Invalid UTF-8] \xaf[Invalid UTF-8] \xae[Invalid UTF-8] \xad[Invalid UTF-8] \xac[Invalid UTF-8] \xab[Invalid UTF-8] \xaa[Invalid UTF-8] \xa9[Invalid UTF-8] \xa8[Invalid UTF-8] \xa7[Invalid UTF-8] \xa6[Invalid UTF-8] \xa5[Invalid UTF-8] \xa4[Invalid UTF-8] \xa3[Invalid UTF-8] \xa2[Invalid UTF-8] \xa1[Invalid UTF-8] \xa0[Invalid UTF-8] \x9f[Invalid UTF-8] \x9e[Invalid UTF-8] \x9d[Invalid UTF-8] \x9c[Invalid UTF-8] \x9b[Invalid UTF-8] \x9a[Invalid UTF-8] \x99[Invalid UTF-8] \x98[Invalid UTF-8] \x97[Invalid UTF-8] \x96[Invalid UTF-8] \x95[Invalid UTF-8] \x94[Invalid UTF-8] \x93[Invalid UTF-8] \x92[Invalid UTF-8] \x91[Invalid UTF-8] \x90[Invalid UTF-8] \x8f[Invalid UTF-8] \x8e[Invalid UTF-8] \x8d[Invalid UTF-8] \x8c[Invalid UTF-8] \x8b[Invalid UTF-8] \x8a[Invalid UTF-8] \x89[Invalid UTF-8] \x88[Invalid UTF-8] \x87[Invalid UTF-8] \x86[Invalid UTF-8] \x85[Invalid UTF-8] \x84[Invalid UTF-8] \x83[Invalid UTF-8] \x82[Invalid UTF-8] \x81[Invalid UTF-8] \x80~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPONMLKJIHGFEDCBA@?>=<;:9876543210/.-,+*)('&%$#"! �

This also happens when piping in input like so: beef test.bf < test.bf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant