|
|||||
|
||||||
Related Syntax | Other Library Functions |
function |
base64.reader |
Library: Character encodings, Base 64 (OMFFBASE64)
Import: omffbase64.xmd |
Return type: Source Returns: A scannable input source for streaming data. |
export external source function reader from value source input-data
Use reader
to read a value source, its argument, and return the binary data of that file converted from a Base 64 encoding to "raw" binary octets. That is, the provided source is in Base 64, but the program sees binary data.
Any input data not recognized as part of a Base 64 encoding is ignored. This is appropriate for white space and for characters used to quote the encoding (such as ">" in email messages), but may erroneously accept input that is not a valid Base 64 encoding.
To use reader
, you must import omffbase64.xmd
into your program using a statement like this:
import "omffbase64.xmd" prefixed by base64.
(Please see the import
topic
for more on importing.)
; Read as much BASE64 encoded data as can be found in #current-input, ; pass it through the BASE64 reader -- which converts it from ; BASE64 to raw data -- and return the raw data as a function's ; result. import "omffbase64.xmd" prefixed by base64. define stream function read-attachment as as return base64.reader from (#current-input take [letter | digit | "+/=%10#%13#"]+)
Related Syntax base64.writer |
Other Library Functions base64.reader base64.writer |