Home >Backend Development >PHP Tutorial >What is the difference between text files and binary files

What is the difference between text files and binary files

WBOY
WBOYOriginal
2016-08-04 09:20:071206browse

For example, if "abcd" is stored in a text file, what is the binary form stored? If it is stored as a binary file, what is the binary form stored? I hope you can give an example

Encoding is only related to storage and has nothing to do with calculation, right?
For example, 2 is a certain value when stored in ASCII, and is given an integer of 4 bytes during calculation 10

Reply content:

For example, if "abcd" is stored in a text file, what is the binary form stored? If it is stored as a binary file, what is the binary form stored? I hope you can give an example

Encoding is only related to storage and has nothing to do with calculation, right?
For example, 2 is a certain value when stored in ASCII, and is given an integer of 4 bytes during calculation 10

Brother is really asking a lot of questions related to binary and encoding, why not ask them together...

All files are essentially the same and are stored in binary. The reason why text files and binary files are distinguished is that text files are mainly used for people to read, so they focus on being readable, and they specifically carry information indicating their own text encoding. In addition, the distinction between text files and binary files is also to inform users that text files can be edited with an ordinary text editor, while binary files are best not to be edited with a text editor.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn