精华区 [关闭][返回]

当前位置:网易精华区>>讨论区精华>>网络专区>>● Internet>>
相关软件
>>网页相关>>Uuencode/decode 知识与使用入门 (三)

主题:Uuencode/decode 知识与使用入门 (三)
发信人: gongx()
整理人: snowypeng(2002-05-23 09:23:23), 站内信件
发信人: bluesea (蓝海), 信区: Virus
标  题: Uuencode/decode 知识与使用入门 (三)
发信站: BBS 水木清华站 (Mon Jun  9 19:25:58 1997)

Uuencode/decode 知识与使用入门 (三)

uuencode
========
Unix program for encoding binary data as ASCII. Uuencode was
originally used with uucp to transfer binary files over serial
lines which did not preserve the top bit of characters but is now
used for sending binary files by e-mail and posting to Usenet
newsgroups etc. The program uudecode reverses the effect of
uuencode, recreating the original binary file exactly.

Uuencoded data starts with a line of the form

        begin <mode> <file>

where <mode> is the files read/write/execute permissions as three
octal digits and <file> is the name to be used when recreating
the binary data.
Uuencode repeatedly takes in a group of three bytes, adding
trailing zeros if there are less than three bytes left. These 24
bits are split into four groups of six which are treated as
numbers between 0 and 63. Decimal 32 is added to each number and
they are ouput as ASCII characters which will lie in the range 32
(space) to 32+63 = 95 (underscore). Each group of sixty ouptut
characters (corresponding to 45 input bytes) is output as a
separate line preceded by an 'M' (ASCII code 77 = 32+45). At the
end of the input, if there are N output characters left after the
last group of sixty and N>0 then they will be preceded by the
character whose code is 32+N. Finally, a line containing just a
single space is output, followed by one containing just "end".

Sometimes each data line has an extra dummy character added to
avoid problems which mailers that strip trailing spaces. These
characters are ignored by uudecode.

Despite using this limited range of characters, there are still
some problems encountered when uuencoded data passes through
certain old computers. The worst offenders are computers using
non-ASCII character sets such as EBCDIC.
uudecode
========
A Unix program to convert the ASCII output of uuencode back to
binary. See uuencode for details.



--
※ 来源:·Netease BBS nease2.gznet.com·[FROM: 202.116.130.31]

[关闭][返回]