二进制字节转换为ASCII覆盖? [英] BINARY BYTE TO ASCII COVERVERTION?

查看:124
本文介绍了二进制字节转换为ASCII覆盖?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个由ascii和二进制数据组成的文件.我使用vim以二进制格式查看它的样子,

I have a file consist of both ascii and binary data . Using vim i view that in binary format , its look like

0000000: 00100100 01010101 00101100 00100000 01001110 00110100  $U, N4
0000006: 00110110 00110100 00110101 01001011 00101010 00110101  645K*5
000000c: 01000110 00001101 00001010 00100100 01000001 00101100  F..$A,

在这里,我发现ASCII也显示二进制值,但是二进制数据显示为."在上面的示例中,"f .. $ a".点代表什么?我还尝试了在线二进制到ASCII转换器,以获取.(dot)"字节0001101和0001101,但它们什么也没显示.它们属于什么?

Here i found that ASCII also show the binary values, but that binary data shows as "." In above example "f..$a" . What are that dots represents? I also tried online binary to ASCII converter for that ".(dot)" bytes 0001101 and 0001101 , but they shows nothing . What they belongs to represent?

推荐答案

这两个二进制值00001101 00001010在右侧的ASCII转储中显示为...如果将它们转换为十六进制,则会看到它们是 0x0d 0x0a ,也称为回车符(CR)和换行符( LF),因为任何ASCII表都会告诉您.您正在查看的文本文件具有Windows样式的行尾!

Those two binary values 00001101 00001010 are shown as .. in the ASCII dump on the right. If you translate them to hexadecimal, you'll see that these are 0x0d 0x0a, also known as Carriage Return (CR) and Line Feed (LF), as any ASCII table will tell you. The text file you're viewing has Windows-style line endings!

这些是空格字符,如果按字面意义包含,则会弄乱ASCII表.这就是为什么.

These are whitespace characters, and if included literally would mess up the ASCII table. That's why they (as well as the unprintable control characters below 32, and any binary values above 127, which aren't defined by ASCII and would need another character set to be interpreted correctly) are represented by .

通常,转储中的二进制/十六进制信息是权威信息,右侧的ASCII表示仅用于帮助理解.

In general, the binary / hex information in a dump is the authoritative one, the ASCII representation to the right is only to aid human comprehension.

这篇关于二进制字节转换为ASCII覆盖?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆