コンテンツへスキップ
uencoder

Quoted-Printable エンコーディングの理解

Quoted-Printable エンコーディングの仕組みと、ほぼ ASCII のテキストで Base64 より有利なケースを学びます。

问题

テキストの大部分が ASCII で一部に非 ASCII 文字が含まれており、可読な部分をそのまま保てる効率的なエンコーディングが必要です。

前提条件

  • メールと MIME の基礎知識
  • ASCII の理解

ステップ

  1. 1. Understand the encoding rule

    Quoted-Printable leaves printable ASCII characters (33-126) as-is, except = which becomes =3D. Non-ASCII bytes and control characters are encoded as =XX where XX is the hex value. This keeps mostly-ASCII text readable and compact.

    入力
    Café
    输出
    Caf=E9
  2. 2. Handle line wrapping

    Quoted-Printable limits line length to 76 characters. If a line exceeds this, a soft line break (= at end of line) is inserted. The decoder removes these soft breaks to reconstruct the original line.

    入力
    long line of text...
    输出
    ...text=
    ...continued
  3. 3. Decode back to original

    The decoder scans for =XX sequences and converts them back to bytes. Soft line breaks (= at end of line) are removed. Hard line breaks (CRLF without a preceding =) are preserved as actual line breaks.

    入力
    Caf=E9
    输出
    Café

期待される結果

ASCII 部分はそのまま読め、非 ASCII バイトは 16 進エスケープされた、コンパクトなエンコードテキスト。

よくあるエラー

Forgetting to encode the = sign itself
The = character must always be encoded as =3D, otherwise the decoder will misinterpret it as an escape prefix.
Lines exceed 76 characters
Insert soft line breaks (=CRLF) before the 76-character limit. Some mail servers reject overly long lines.

トラブルシューティング指引

  • If decoded text shows stray = characters, the encoder failed to encode = as =3D.
  • If lines are joined incorrectly, check that soft breaks (= at EOL) are distinguished from hard breaks.

セキュリティ上の制限

  • Quoted-Printable is a transport encoding with no security properties.

関連ツール

関連用語

参考链接