1.\" Copyright (c) 1989, 1991, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" %sccs.include.redist.roff%
5.\"
6.\"	@(#)uuencode.format.5	8.2 (Berkeley) 01/12/94
7.\"
8.Dd
9.Dt UUENCODE 5
10.Os BSD 4
11.Sh NAME
12.Nm uuencode
13.Nd format of an encoded uuencode file
14.Sh DESCRIPTION
15Files output by
16.Xr uuencode 1
17consist of a header line,
18followed by a number of body lines,
19and a trailer line.
20The
21.Xr uudecode 1
22command
23will ignore any lines preceding the header or
24following the trailer.
25Lines preceding a header must not, of course,
26look like a header.
27.Pp
28The header line is distinguished by having the first
296 characters
30.Dq begin\ \&
31(note the trailing space).
32The word
33.Em begin
34is followed by a mode (in octal),
35and a string which names the remote file.
36A space separates the three items in the header line.
37.Pp
38The body consists of a number of lines, each at most 62 characters
39long (including the trailing newline).
40These consist of a character count,
41followed by encoded characters,
42followed by a newline.
43The character count is a single printing character,
44and represents an integer, the number of bytes
45the rest of the line represents.
46Such integers are always in the range from 0 to 63 and can
47be determined by subtracting the character space (octal 40)
48from the character.
49.Pp
50Groups of 3 bytes are stored in 4 characters, 6 bits per character.
51All are offset by a space to make the characters printing.
52The last line may be shorter than the normal 45 bytes.
53If the size is not a multiple of 3, this fact can be determined
54by the value of the count on the last line.
55Extra garbage will be included to make the character count a multiple
56of 4.
57The body is terminated by a line with a count of zero.
58This line consists of one
59.Tn ASCII
60space.
61.Pp
62The trailer line consists of
63.Dq end
64on a line by itself.
65.Sh SEE ALSO
66.Xr uuencode 1 ,
67.Xr uudecode 1 ,
68.Xr uusend 1 ,
69.Xr uucp 1 ,
70.Xr mail 1
71.Sh HISTORY
72The
73.Nm uuencode
74file format appeared in
75.Bx 4.0 .
76.\" It was named uuencode.5 prior to 4.3
77