I am assuming it inputs the byte stream of the file to the text parser and only glibberish comes out
can confirm
Doing god’s work, child.
teaching intro CS to middle schoolers?
Believe it or not, straight to jail
Open a text file in media player? Also straight to jail
my afternoon project recommendation is to open a jpg or bmp in audacity, cut the first bit off to save the header then apply random audio effects to the rest. you can create really cool trippy glitch art this way
Wouldnt removing the header mess with reading the file?
I think they’re saying snip the header off so you don’t affect it, then reapply at the end.
It’ll “work”. A motivated and forgiving text editor will take the binary data and show it to you in the form of text, but this text will look like someone threw a hand grenade into a unicode cosplay convention.
Binary to text is possible in theory, but as everyone who has accidentally sent the output of a binary file to the terminal can tell you, it rarely works very well.
If you really want to “read” the file as text, it’s best to run it through a base64 decoder, so that the output will be limited to characters that are actually readable. The resulting text can then be encoded again and sent to a new file, and you will have a reproducible text string that represents your original file.
Try it and see. It won’t hurt anything.
I feel like there’s a very large number of people that are afraid of trying things on their computer just to see what happens. And it correlates pretty closely with the type of person that doesn’t know where anything is on their computer.
OP is at least asking questions, and that’s a great step towards learning by yourself.
Eeh, they’ve got a point though. This is the result of accidentally cating an image in TTY:
Fixable with a reboot. Shouldn’t cause issues with any normal text editor, but because it shouldn’t doesn’t mean it necessarily won’t.
Now cat a plain text file to your sound device as it exists in
/dev
(e.g.,/dev/audio
). Then do an audio file. You should hear stuff come out of your speakers.PS. When your terminal looks like that, you should be able to type
reset
and press enter to fix it without a reboot.
Isn’t that also what you say about your dog? Like moments before it’ll bite someone? (…It just wants to play…)
Just try it?
Only one way to find out
A word processor like MS Word or LibreOffice Writer will probably refuse to open it, giving some error such as “unsupported file type.”
Depending on how much of a nerd you are, the plaintext editor your OS comes with may either also refuse to open it, or open it as if it were plaintext and you might see a few jumbles of letters and punctuation, or weird symbols if it interprets it as unicode. According to Vim, my mp3 copy of Glycerine by Bush is mostly @ symbols. I noticed that my Bash shell didn’t want to autocomplete “Vim glycerine.mp3” but when typed manually it did it with minimal fuss.
If you open it in a hex editor, you might be surprised to see the first few lines are readable, they likely contain metadata that media player software like VLC can understand, like the track name, artist, year of release and such. Scroll down further and you’ll start to see more gibberish where it’s trying to interpret the individual bytes that make up the audio as ASCII characters. Funnily enough hexedit gave me a different looking bunch of gibberish than Vim did.
MS word and whatever Open/libre Office equivalent will likely throw a format error and show the encoded data as question marks inside a diamond.
Nothing horrible will happen, the MP3 will be fine the word processor will spaz out a bit.
All files are made up of “text”, or rather, numbers. How each program interprets those numbers differs depending on the kind of work they do. Any program can open any file, but the way it translates those numbers won’t make any sense if the file wasn’t intended to be opened by that kind of program. So, if you opened an MP4, you might see a little bit of metadata that was encoded in a way the text editor can understand, and then you’d get a ton of random symbols, some that are numbers and letters you recognize, but a lot of them would be specialized characters from farther on in the list of characters whatever font is being used might have.
Think of it this way: take two human languages that use the same writing system, like German and French. Suppose you ask a Frenchman who also speaks English to translate and write down a few specific sentences. You then take those sentences to a German who also speaks English (but not French) and ask her to translate it into English. Obviously she can’t. She might be able to sound out the words, but neither of you will know what it means, and it probably wouldn’t sound right to a French speaker. Or better yet, you can ask her to try and guess what each word means. She’d likely come up with mostly nonsense (minus a few cognates and loanwords). This isn’t an exact analogy, but that’s basically what’s going on.
It’ll likely crash the editor, but if it doesn’t then you get cool Matrix code. That’s actually how we used to make Matrix backgrounds back in the day, open an image in a text editor, copy the code, transform it to vertical, change it to green, eureka!
But what is all that crap? Is that the literal machine code or something? Like what is it and in the eff does it actually goid-enough approximate its subject content?
Every file is made up of zeroes and ones, what’s different between the formats is how those zeroes and ones are interpreted. When you open a mp4 in a text editor what you see is the result of the text editor interpreting the data as if it were text. Since the data doesn’t actually represent text, the result is meaningless garbage.
All any file is is just numbers. Opening a file in a program is just interpreting those numbers. To over-simplify, in a plain text file, for example, the number 32 means “space character”, and the number 10 means “move down to a new line”. In an audio file, the numbers are going to have meaning related to volume and frequency of sound, at points in time.
Every single file on a computer is stored as zeros and ones, the difference between opening a file in VLC or in Notepad is how the program decode the data.
I actually have a very good analogy to explain the issue of decoding data, this happened to me in a shop.
I am a Swede, I consider myself being bilingual Swedish/English, I live and work in Sweden.
After work one day I decided that I wanted some Itallian food so I walked by Eatatly in Stockholm.
As I got to the cashier to pay, I thought I heard her speak Swedish, but as she started talking to me, I only heard gibberish, I could not understand her at all, it took me 2-3 sec to realize that she was speaking English, and when that clicked, I suddenly understood everything.
It was so weird, it was like my English comprehension was just turned off and needed to restart.
Now, this is bascially what happens when you try and open a music file in Notepad, only it can’t understand music at all and doesn’t have the option to give up unless it hits a hard limit.
So it uses what it knows to try and decode thw file, it takes the birnary data and decodes it as a text file, and since the music data does not corespond to proper text standards it will just do it’s best and give you a long document of incomprehensable characters.
There are some interesting ways to mess with files and different programs to find/do interesting stuff.
For instance, you can hide a zip file in a JPG file: https://www.howtogeek.com/119365/how-to-hide-zip-files-inside-a-picture-without-any-extra-software/
This would only really work in hiding small ammounts of data, and will not prevent detection by law enforcement.
.docx, .xlsx, .pptx and other new office documents are actually zip files, you can open the file in 7zip and examine the file that way.
This is interesting, but I haven’t found a real use for it.