HOME

TheInfoList



OR:

xxencode is a
binary-to-text encoding A binary-to-text encoding is encoding of data in plain text. More precisely, it is an encoding of binary data in a sequence of printable characters. These encodings are necessary for transmission of data when the channel does not allow binary ...
similar to uuencode which uses only the alphanumeric characters, and the plus and minus signs. It was invented as a means to transfer files in a format which would survive character set translation, particularly that between
ASCII ASCII ( ), abbreviated from American Standard Code for Information Interchange, is a character encoding standard for electronic communication. ASCII codes represent text in computers, telecommunications equipment, and other devices. Because ...
and the
EBCDIC Extended Binary Coded Decimal Interchange Code (EBCDIC; ) is an eight- bit character encoding used mainly on IBM mainframe and IBM midrange computer operating systems. It descended from the code used with punched cards and the corresponding ...
encoding used on IBM mainframes.


The encoding process

xxencoded data starts with a line of the form: begin Where is the file's read/write/execute permissions as three octal digits, and is the name to be used when recreating the binary data. xxencode repeatedly takes in groups of three bytes, adding trailing zeroes if there are fewer than three bytes left. These 24 bits are split into four 6-bit numbers, each of which is then translated to the nth character in the following table: 1 2 3 4 5 6 0123456789012345678901234567890123456789012345678901234567890123 , , , , , , , +-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz 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 lines except the last, this will be the character 'h' (the character mapping to the value 45). If the input is not evenly divisible by 45, the last line will contain the remaining N output characters, preceded by the number of remaining input bytes encoded as above. Finally, a line containing just a single space (or plus character) is output, followed by one line containing the string "end". xxencoded data is generally distinguishable from Uuencoded data by the first character of the line ('h' for Xxencode, 'M' for Uuencode). This assumes at least one full-length line (45 encoded bytes/60 characters) in the output.


Example

The following is an example of xxencoding a one-line text file. In this example, is the byte representation for
carriage return A carriage return, sometimes known as a cartridge return and often shortened to CR, or return, is a control character or mechanism used to reset a device's position to the beginning of a line of text. It is closely associated with the line feed ...
(CR), and is the byte representation for
line feed Newline (frequently called line ending, end of line (EOL), next line (NEL) or line break) is a control character or sequence of control characters in character encoding specifications such as ASCII, EBCDIC, Unicode, etc. This character, or a ...
(LF). ;file File Name = wikipedia-url.txt File Contents = http://www.wikipedia.org%0D%0A ;xxencoding begin 644 wikipedia-url.txt OO5FoQ1cj9rRrRmtrOKhdQ4JYOK2iPr7b1Ec+ end


See also

*
Binary-to-text encoding A binary-to-text encoding is encoding of data in plain text. More precisely, it is an encoding of binary data in a sequence of printable characters. These encodings are necessary for transmission of data when the channel does not allow binary ...
for a comparison of various encoding algorithms


External links


XXENCODE-XXDECODE
- Free on-line XXEncoder and XXDecoder


References

{{lowercase Unix software Binary-to-text encoding formats de:xxencode