题目描述

解题步骤
下载附件,得到:
1
| =E9=82=A3=E4=BD=A0=E4=B9=9F=E5=BE=88=E6=A3=92=E5=93=A6
|
科普
Quoted-Printable(简称 QP 编码)是一种 电子邮件和互联网协议中常用的编码方式,主要用于在 7-bit 安全的传输环境中(如 SMTP 邮件)安全地传输 8-bit 数据(比如非 ASCII 字符、中文、特殊符号等)。
Python 中的编码与解码
使用 quopri 模块(标准库)
1 2 3 4 5 6 7 8 9 10 11 12 13
| import quopri
# 原始文本(bytes 类型) text = "Hello, 世界!".encode('utf-8')
# 编码 encoded = quopri.encodestring(text) print("编码结果:", encoded.decode()) # 输出:Hello, =E4=B8=96=E7=95=8C!
# 解码 decoded_bytes = quopri.decodestring(encoded) decoded_text = decoded_bytes.decode('utf-8') print("解码结果:", decoded_text) # 输出:Hello, 世界!
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| import quopri
encoded_str = "=E9=82=A3=E4=BD=A0=E4=B9=9F=E5=BE=88=E6=A3=92=E5=93=A6"
encoded_bytes = encoded_str.encode('utf-8')
decoded_bytes = quopri.decodestring(encoded_bytes)
decoded_text = decoded_bytes.decode('utf-8')
print("QP 编码文本:", encoded_str)
print("解码结果:", decoded_text)
|
flag:flag{那你也很棒哦}