.dat
it’s just any name, it indicates nothing about what it has inside, there’s even no specification that says that a .dat
should be one way or another, just as a `.txt also does not, although it is customary to use text without any formatting.
They use it to say that there’s data in there, nothing else, every use can be one way. Obviously, something that has binary data (encoded like this, accepting the entire range of a Bute and not just a subset, because technically only text also has a binary form) is more common, whereas a .txt
it is expected to have only simple texts.
For you to view can only open in any editor, some will show binary data better than others, but they will be essentially unreadable. Some editors are made to read binaries and have specific tools for this.
Apart from this you can create a code that opens and reads all data freely, ie byte per byte without caring about the content.