I have got a base64 encoded data stream embeded in an XML file, which I like to decode.
I copied the data into a new file and gave it the extension .b64, but Servant Salamander created only an empty folder on extraction.
I then searched the Internet for a file format specification for .b64 files, but could not find any.
Would you please point me in the right direction.
.B64 file format
-
- Plugin Developer
- Posts: 707
- Joined: 08 Dec 2005, 14:33
- Location: Prague, Czech Republic
- Contact:
Re: .B64 file format
If you want the UnMime plugin to recognized Base64-encoded data, precede the data with the following line, followed by one more empty line.SvA wrote:I have got a base64 encoded data stream embeded in an XML file, which I like to decode.
I copied the data into a new file and gave it the extension .b64, but Servant Salamander created only an empty folder on extraction.
I then searched the Internet for a file format specification for .b64 files, but could not find any.
Would you please point me in the right direction.
Content-transfer-encoding: BASE64
BASE64 encoding is very simple - every 3 bytes of input data are converted into 4 characters from 64-item alphabet "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/". In case the size of the input is not divisible by 3, then the last output quadruplet is padded by '=' signs. E.g.:
ABCDEF== decodes as 0x00 0x10 0x83 0x10.
Thank you, Jan, for your response.
Adding mime headers and breaking up the character stream into lines of 76 characters according to mime standard was what I did, since it was the UnMIME plugin which felt responsible.
Without breaking up the lines (i.e. just adding the header(s) I got a corrupted image on decoding (without any warning!).
There are many references to the .b64 extension related to base64 encoded data, so I thought there must be also a file specification (similar to a uuencoded file which has a file header) or else the file contains nothing but the encoded data stream (possibly with added white space.
Are there any requirements on a MIME file to be legitimately called .b64 (in general, not limited to Servant Salamander)?
Adding mime headers and breaking up the character stream into lines of 76 characters according to mime standard was what I did, since it was the UnMIME plugin which felt responsible.
Without breaking up the lines (i.e. just adding the header(s) I got a corrupted image on decoding (without any warning!).
There are many references to the .b64 extension related to base64 encoded data, so I thought there must be also a file specification (similar to a uuencoded file which has a file header) or else the file contains nothing but the encoded data stream (possibly with added white space.
Are there any requirements on a MIME file to be legitimately called .b64 (in general, not limited to Servant Salamander)?
-
- Plugin Developer
- Posts: 707
- Joined: 08 Dec 2005, 14:33
- Location: Prague, Czech Republic
- Contact:
I don't think there is any standard/recommendation for exact file suffix and/or structure. There is no real reason to have standalone base64-encoded files, the encoding is meant to be transfer encoding, not file storage encoding, although various file formats (such as PostScript or PDF) may use it internally.SvA wrote:Are there any requirements on a MIME file to be legitimately called .b64 (in general, not limited to Servant Salamander)?