Pop-11 Procedures for encoding and decoding BASE64 files (mimencode) 
Author Message
 Pop-11 Procedures for encoding and decoding BASE64 files (mimencode)

I have added the following to the Birminhgam local extension to pop-11

    http://www.*-*-*.com/
    http://www.*-*-*.com/

These provide basic facilities for producing a BASE64 encoded version of
a file, and for decoding such a file. They can be used to produce
attachments to go with mail files, or to decode such attachments.

Better than uuencode/uudecode partly because not all systems support
them and because uuencode can produce trailing spaces causing
confusions.

Better than binhex - not everyone can decode binhex.

1. The first file defines this procedure:

mimeencode(input, output);

input is a string, representing a file name, or a character repeater.

output is a string, representing a file name, or a character consumer.

8 bit characters from input are read in three at a time, the 24 bits
divided into four groups of 6 bits, the 6 bits encoded using the base 64
algorithm, and four 6 bit printable characters are output. After every
72 characters a newline is output.

If the last block of characters contains fewer than three, then padding with
zeros is used to output two or three six bit characters, as appropriate, and
one or two `=` characters output to complete the group of four.

See RFC 2045

2. The second file defines the reverse procedure:

mimedecode(input, output);

input is a string, representing a file name, or a character repeater.

output is a string, representing a file name, or a character consumer.

6 bit characters from input are read in four at a time, decoded, and then
output as three 8 bit characters. Newlines are ignored.

The final group of four characters may end with one or two = signs, and
in that case have to treated specially. If there is only one `=`, then
use the first three characters to generate two characters to be output.
If there are two `=` signs, then use only the first two characters to
generate one character to be output.

Comments and suggestions welcome.

Later ved_send will be extended to use mimencode to produce attachments,
and ved_decode will be extended to use mimedecode to decode base64
attachments to mail messages (in case you don't have mimencode -u)

I don't suppose anyone has written a procedure to decode
Printed-quotable text?

Aaron
===
Aaron Sloman, ( http://www.*-*-*.com/ ~axs/ )
School of Computer Science, The University of Birmingham, B15 2TT, UK

PAPERS: http://www.*-*-*.com/
TOOLS: http://www.*-*-*.com/



Tue, 19 Nov 2002 03:00:00 GMT  
 Pop-11 Procedures for encoding and decoding BASE64 files (mimencode)

From: Aaron Sloman See text for reply address

Quote:
>I have added the following to the Birminhgam local extension to pop-11

>    http://www.cs.bham.ac.uk/research/poplog/auto/mimencode.p
>    http://www.cs.bham.ac.uk/research/poplog/auto/mimedecode.p

>These provide basic facilities for producing a BASE64 encoded version of
>a file, and for decoding such a file. They can be used to produce
>attachments to go with mail files, or to decode such attachments.

  (snip)

Quote:
>See RFC 2045
  (snip)
>I don't suppose anyone has written a procedure to decode
>Printed-quotable text?

It may be worth commenting that the spec. for printed-quotable is
given in the same RFC 2045 which you mention in passing in your
original message (in case anyone wants to implement it). It's fairly
easy to locate on the 'net.

Jonathan



Tue, 19 Nov 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. base64 encoding/decoding

2. base64 decoding/encoding library

3. Ruby base64 encoding/decoding

4. Regular expression string pattern matching: Embedding pop-11 procedures, and more

5. looking for file processing programs written in Pop-11

6. decoding base64 using cobol on os390

7. Base64 Decoding

8. base64 decoding

9. base64 decode problem

10. A POP-11 Book Available via FTP

11. calling prolog from pop-11

12. Development of Pop-11 for Windows

 

 
Powered by phpBB® Forum Software