CodeToolProCodeToolPro
GitHub

Quoted-Printable Codec

Text to Encode

  • Quoted-Printable Encoded

  • Quoted-Printable to Decode

    Decoded Text

  • Quoted-Printable (RFC 2045): Used in email MIME encoding. Printable ASCII characters pass through unchanged. Non-printable characters are encoded as =XX (hex). Lines are limited to 76 characters with soft breaks ending in =.

    技术详情

    Quoted-Printable 编解码器的工作原理

    工具功能

    Quoted-Printable(简称 QP)编解码器可在文本与 Quoted-Printable 编码格式之间互相转换。Quoted-Printable 是一种将 8 位字符数据转换为 7 位 ASCII 的编码方式,主要在电子邮件 MIME 协议中使用,确保非 ASCII 字符(如中文、特殊符号)能在只支持 7 位 ASCII 的邮件传输系统中安全传递。


    常见开发者使用场景

    Quoted-Printable 编码主要用于电子邮件系统:当邮件正文或邮件头包含非 ASCII 字符时,MIME 标准规定使用 QP 编码确保兼容性。开发者在处理邮件解析程序、读取 email 原始内容(如 .eml 文件)、调试邮件编码问题、以及编写邮件发送功能时都可能遇到 QP 编码数据。

    处理其他编码格式时可参考 Base64 编解码器(MIME 的另一种常用编码)、HTML 编码器URL 编码器Unicode 转换器 可以处理字符编码相关问题。


    技术原理/相关概念

    Quoted-Printable 编码规则:可打印的 ASCII 字符(十进制 33-60 和 62-126)直接原样保留;等号 = 编码为 =3D;非 ASCII 字节(≥128)编码为 = 后跟十六进制值(如 =E4=B8=AD 表示中文"中"的 UTF-8 字节序列);每行最多 76 个字符,长行在末尾插入 = 作为软换行符。解码时反向执行这些规则恢复原始内容。


    常见陷阱与注意事项

    • 字符编码集:QP 编码通常与 Content-Transfer-Encoding 配合使用,需同时关注 Content-Type 中声明的 charset(如 UTF-8、ISO-8859-1),解码时需使用正确的字符集。
    • 软换行符:行末的 = 表示软换行,不是等于号的编码。解码时需识别并正确合并这些断行。
    • 与 URL 编码的区别:QP 使用 =XX 格式(大写十六进制),而 URL 编码使用 %XX。两者不同,不要混用。
    • Base64 对比:QP 编码适合主要包含 ASCII 字符的文本,Base64 更适合二进制数据。QP 编码后文本仍大致可读,而 Base64 完全不可读。

    何时使用此工具而非代码

    在解析邮件内容、调试邮件编码问题或快速解码 QP 编码的字符串时使用此工具。适合邮件开发和运维人员临时处理编码问题。对于集成到邮件系统的场景,推荐使用编程语言的邮件库(如 Python 的 quopri 模块、Java 的 javax.mail.internet.MimeUtility、JavaScript 的 quoted-printable 库),它们提供完整的 MIME 处理能力。

    How to Use Quoted-Printable Codec

    1. 1Enter your input data into the tool
    2. 2Adjust any available options or settings
    3. 3View the output result displayed instantly
    4. 4Copy, download, or share the result

    Frequently Asked Questions

    • Do I need to install anything?

      No. CodeToolPro runs entirely in your browser. No downloads, no browser extensions, no app installations required.

    • Is Quoted-Printable Codec free?

      Yes, 100% free. No registration, no credit card required. All tools are freely available for developers worldwide.

    • Does this tool upload my data to any server?

      No. All processing runs locally in your browser using client-side JavaScript. Your input data, code, or files never leave your device. We do not store, log, or transmit any user data.