Skip to content

Main content

Mime Q Literal Escape Choice Tool

Encode one generic RFC 2047 Q encoded-text octet; context-specific phrase restrictions are outside this fragment.

Loading tool…

Description

Emit underscore for ASCII space, a literal printable ASCII character from 33-126 except =, ? and _, or otherwise an equals sign plus uppercase two-digit hexadecimal.

MIME encoded-words represent non-ASCII header text using a declared charset and B or Q encoding. Q encoding has special treatment for space and some punctuation; a valid local token is not necessarily a valid header in every context.

Emit underscore for ASCII space, a literal printable ASCII character from 33-126 except =, ? and _, or otherwise an equals sign plus uppercase two-digit hexadecimal.

When to use this tool

Use Mime Q Literal Escape Choice when checking one encoded-word or Q encoded-text component.

How to use the tool and how it works

  1. Enter octet. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read token. Use the output convention below.

Require whole octet in [0,255]. Emit underscore for ASCII space, a literal printable ASCII character from 33-126 except =, ? and _, or otherwise an equals sign plus uppercase two-digit hexadecimal.1

Encoded-word syntax, Q escaping and header-context restrictions are separate requirements. This tool checks only its stated local part.2

Input fieldMeaning and unitsAccepted input
octetSingle encoded-text source byte in [0,255], not a Unicode code point.Required. Safe integer; minimum 0; maximum 255.
Output fieldInterpretationReturned shape
tokenTokenRequired. Text; maximum UTF-16 length 8192.
json
{
  "input": {
    "octet": 61
  },
  "output": {
    "token": "=3D"
  }
}

Limitations and assumptions

  • This is one general Q encoded-text octet choice. Context-specific restrictions inside header phrases can require more escaping; a complete encoded-word, charset conversion and line limits are not handled.
  • Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
  • Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.

Alternative or Complementary methods

Use a conforming MIME header encoder for charset conversion, complete payload encoding, contextual restrictions and line folding.

References

  1. Calculation and input contract: encode/mime-q-literal-escape-choice — tool.io

  2. MIME encoded-word syntax: RFC 2047 — Internet Engineering Task Force

Similar or alternative tools