二进制文件中\x00是什么意思?
有一次我问一个人“ASCII 和二进制文件有什么区别?”
他说“二进制文件总是有 \x00”
我一直在搜索这个并发现 PHP 中 \x00 、 \x04 的含义是什么
所以结论是,ASCII 文件没有 NULL 字符?
Once I asked a guy "what is the difference between ASCII and Binary files?"
And he said "Binary files always have \x00"
I've been searching about this and found What is the meaning of \x00 , \x04 in PHP
so the conclusion is, ASCII files don't have NULL character?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
ASCII 文件可能被读取或解释为具有 NULL 终止的字符串、回车符和字符。用于读取和操作的换行符或其他控制字符。例如,文本阅读器可能会查找一行文本,其中一行是“在换行之前看到的任意字符”
二进制文件被认为只是一个字节序列 - 它们都没有任何特殊的意思是,文本阅读器会解释它们。
\x00 是特定字节值(十六进制 0)的示例,文本阅读器可能会以特殊方式解释它。
An ASCII file might be read or interpreted as having NULL-terminated strings, carriage returns & line-feeds, or other control characters, that are intended to be read and acted on. For example, a text reader might look for a line of text, where a line is "however many characters you see before you get to a linefeed"
A binary file is considered to be just a sequence of bytes - none of them has any special meaning, in the sens that a text-reader would interpret them.
\x00 is an example of a specific byte value (HEX 0), that might be interpreted in a special way by a text reader.
错误的。 ASCII 文件有 NULL 字符。事实上,ASCII 中的每个字符串都以 NULL 结尾。
ASCII 文件是仅包含 ASCII 字符 x0 - x127 的文件。
二进制文件包含数据,每个字节可以是一个 ASCII 字符、一个整数、指针等。它只是如何将数据写入文件以及如何将其返回。
Wrong. ASCII files have NULL characters. In fact, every string in ASCII ends at a NULL.
ASCII files are files that only contain ASCII characters x0 - x127.
Binary files contain data and each individual byte can be an ascii character, an integer, pointer, etc. Its just how to write data to the file and how you rad it back.