Uuencode

Uuencode is a form of ASCII armor that originated as a Unix program for encoding binary data for transmission over the uucp mail system. The name "uuencode" is derived from "Unix-to-Unix encoding". Since uucp converted characters between various computer's character sets, uuencode was used to convert the data to fairly common characters that were unlikely to be "translated" and thereby destroy the file. The program uudecode reverses the effect of uuencode, recreating the original binary file exactly. uuencode/decode became popular for sending binary files by e-mail and posting to usenet newsgroups etc.

Contents

The encoding process

Uuencoded data starts with a line of the form:

begin  <mode> <file>

Where <mode> is the file's 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 output as ASCII characters which will lie in the range 32 (space) to 32+63 = 95 (underscore). ASCII characters greater than 95 may also be used; however, only the six right-most bits are relevant.

Each group of sixty output characters (corresponding to 45 input bytes) is output as a separate line preceded by an encoded character giving the number of encoded bytes on that line. For all line except the last, this will be the character 'M' (ASCII code 77 = 32+45). If the input is not evenly divisble by 45, the last line of will contain the remaining N output characters, preceded by the character whose code is 32+N. Finally, a line containing just a single space (or grave character) is output, followed by one line containing the string "end".

Sometimes each data line has extra dummy characters (often the grave accent) added to avoid problems with mailers that strip trailing spaces. These characters are ignored by uudecode. The grave accent (ASCII 96) can also be used in place of a space character. When stripped of their high bits they both decode to 000000.

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.

Sample uuencode

The diagram shows the uuencoding of the three ASCII encoded characters Cat into its uuencoded representation 0V%T. Missing image
Uuencode.png
The uuencoding process

If the complete uuencoded output of the three ASCII characters Cat might appear as the following

begin 644 cat.txt
#0V%T
`
end

Uuencode table

The following table represents the subset of ASCII characters used by UUEncode and the 6-bit binary string they represent.

Printable
Representation
ASCII Decimal Binary
Representation
Printable
Representation
ASCII Decimal Binary
Representation
(space) 32 000 000   @ 64 100 000
! 33 000 001   A 65 100 001
" 34 000 010   B 66 100 010
# 35 000 011   C 67 100 011
$ 36 000 100   D 68 100 100
% 37 000 101   E 69 100 101
& 38 000 110   F 70 100 110
' 39 000 111   G 71 100 111
( 40 001 000   H 72 101 000
) 41 001 001   I 73 101 001
* 42 001 010   J 74 101 010
+ 43 001 011   K 75 101 011
, 44 001 100   L 76 101 100
- 45 001 101   M 77 101 101
. 46 001 110   N 78 101 110
/ 47 001 111   O 79 101 111
0 48 010 000   P 80 110 000
1 49 010 001   Q 81 110 001
2 50 010 010   R 82 110 010
3 51 010 011   S 83 110 011
4 52 010 100   T 84 110 100
5 53 010 101   U 85 110 101
6 54 010 110   V 86 110 110
7 55 010 111   W 87 110 111
8 56 011 000   X 88 111 000
9 57 011 001   Y 89 111 001
: 58 011 010   Z 90 111 010
; 59 011 011   [ 91 111 011
< 60 011 100   \ 92 111 100
= 61 011 101   ] 93 111 101
> 62 011 110   ^ 94 111 110
? 63 011 111   _ 95 111 111
  ` 96 (1) 000 000

See also

References

This article was originally based on material from the Free On-line Dictionary of Computing, which is licensed under the GFDL.
de:UUencode
Navigation

  • Art and Cultures
    • Art (https://academickids.com/encyclopedia/index.php/Art)
    • Architecture (https://academickids.com/encyclopedia/index.php/Architecture)
    • Cultures (https://www.academickids.com/encyclopedia/index.php/Cultures)
    • Music (https://www.academickids.com/encyclopedia/index.php/Music)
    • Musical Instruments (http://academickids.com/encyclopedia/index.php/List_of_musical_instruments)
  • Biographies (http://www.academickids.com/encyclopedia/index.php/Biographies)
  • Clipart (http://www.academickids.com/encyclopedia/index.php/Clipart)
  • Geography (http://www.academickids.com/encyclopedia/index.php/Geography)
    • Countries of the World (http://www.academickids.com/encyclopedia/index.php/Countries)
    • Maps (http://www.academickids.com/encyclopedia/index.php/Maps)
    • Flags (http://www.academickids.com/encyclopedia/index.php/Flags)
    • Continents (http://www.academickids.com/encyclopedia/index.php/Continents)
  • History (http://www.academickids.com/encyclopedia/index.php/History)
    • Ancient Civilizations (http://www.academickids.com/encyclopedia/index.php/Ancient_Civilizations)
    • Industrial Revolution (http://www.academickids.com/encyclopedia/index.php/Industrial_Revolution)
    • Middle Ages (http://www.academickids.com/encyclopedia/index.php/Middle_Ages)
    • Prehistory (http://www.academickids.com/encyclopedia/index.php/Prehistory)
    • Renaissance (http://www.academickids.com/encyclopedia/index.php/Renaissance)
    • Timelines (http://www.academickids.com/encyclopedia/index.php/Timelines)
    • United States (http://www.academickids.com/encyclopedia/index.php/United_States)
    • Wars (http://www.academickids.com/encyclopedia/index.php/Wars)
    • World History (http://www.academickids.com/encyclopedia/index.php/History_of_the_world)
  • Human Body (http://www.academickids.com/encyclopedia/index.php/Human_Body)
  • Mathematics (http://www.academickids.com/encyclopedia/index.php/Mathematics)
  • Reference (http://www.academickids.com/encyclopedia/index.php/Reference)
  • Science (http://www.academickids.com/encyclopedia/index.php/Science)
    • Animals (http://www.academickids.com/encyclopedia/index.php/Animals)
    • Aviation (http://www.academickids.com/encyclopedia/index.php/Aviation)
    • Dinosaurs (http://www.academickids.com/encyclopedia/index.php/Dinosaurs)
    • Earth (http://www.academickids.com/encyclopedia/index.php/Earth)
    • Inventions (http://www.academickids.com/encyclopedia/index.php/Inventions)
    • Physical Science (http://www.academickids.com/encyclopedia/index.php/Physical_Science)
    • Plants (http://www.academickids.com/encyclopedia/index.php/Plants)
    • Scientists (http://www.academickids.com/encyclopedia/index.php/Scientists)
  • Social Studies (http://www.academickids.com/encyclopedia/index.php/Social_Studies)
    • Anthropology (http://www.academickids.com/encyclopedia/index.php/Anthropology)
    • Economics (http://www.academickids.com/encyclopedia/index.php/Economics)
    • Government (http://www.academickids.com/encyclopedia/index.php/Government)
    • Religion (http://www.academickids.com/encyclopedia/index.php/Religion)
    • Holidays (http://www.academickids.com/encyclopedia/index.php/Holidays)
  • Space and Astronomy
    • Solar System (http://www.academickids.com/encyclopedia/index.php/Solar_System)
    • Planets (http://www.academickids.com/encyclopedia/index.php/Planets)
  • Sports (http://www.academickids.com/encyclopedia/index.php/Sports)
  • Timelines (http://www.academickids.com/encyclopedia/index.php/Timelines)
  • Weather (http://www.academickids.com/encyclopedia/index.php/Weather)
  • US States (http://www.academickids.com/encyclopedia/index.php/US_States)

Information

  • Home Page (http://academickids.com/encyclopedia/index.php)
  • Contact Us (http://www.academickids.com/encyclopedia/index.php/Contactus)

  • Clip Art (http://classroomclipart.com)
Toolbox
Personal tools