I’ve noticed some files I opened in a text editor have all kinds of crazy unrenderable chars

  • Nibodhika@lemmy.world
    link
    fedilink
    arrow-up
    5
    ·
    2 months ago

    At the end of the day data is just binary, i.e. it’s composed of 0 and 1. What those 0 and 1 represent is mostly irrelevant to this discussion. The short version is that 01000001 can mean A or it can mean that a given pixel is 65/256 red, or that the speaker should vibrate in a specific frequency, etc, etc.

    So what happens when you open a file that’s not text in a text editor? Well, some of the 0 and 1 make up gibberish, or characters that are not meant to be printed. Fun fact, you should be able do this the other way around too, i.e. open a text as an image, but again it will be gibberish, and most likely would not load since images have lots of information that relate to size, compression, etc, that if incorrect the program won’t know what to do, but because text can always be valid it will always work, although sometimes your editor might show weird thing in the places where there’s a non-printable character.