XXencode

binary-to-text encoding

Uses your system voice; voice and rate in settings.

The name shown is in de. The article below is in English and is not a translation.

Q8045328Snapshot

≈ 3 min read

Names in other languages

  • EnglishXxencodingImproper Restriction of XML External Entity Reference
  • gaXxencoding
  • DeutschXXencode
  • 日本語Xxencode
  • РусскийXxencode

Article bodies are English and are not machine-translated. A name in another language is not a translation of the article.

xxencode is a binary-to-text encoding 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 and the EBCDIC encoding used on IBM mainframes.[1]

Contents

The encoding process

edit edit source

xxencoded data starts with a line of the form:

begin <mode> <file>

Where <mode> is the file's read/write/execute permissions as three octal digits, and <file> 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

edit edit source

The following is an example of xxencoding a one-line text file. In this example, %0D is the byte representation for carriage return (CR), and %0A is the byte representation for line feed (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

edit edit source edit edit source

References

edit edit source
  1. ^ Tony Catone (February 1995). "Keys to the kingdom: Unlocking Internet file formats". University of Pennsylvania. Wikipedia revision 1284672969, retrieved 2026-11-20

Text derived from https://en.wikipedia.org/w/index.php?oldid=1284672969 under CC BY-SA 4.0; modifications have been made.

Provenance

snapshot xxencoding-905800-b763d7d57ee7596f · hash b763d7d57ee7596f20a4371bf18a7c133ae496b4970e236b15f5f7b33710801a · captured 2025-04-08 · not yet sealed in the ledger · verify the chain · version history

Cite this page as: encyclopegia.org, “XXencode”, snapshot xxencoding-905800-b763d7d57ee7596f. https://encyclopegia.org/a/xxencoding