将文本编码为符合 RFC 2047 标准的格式
(text: str)
| 807 | """ |
| 808 | |
| 809 | def encode_rfc2047(text: str) -> str: |
| 810 | """将文本编码为符合 RFC 2047 标准的格式""" |
| 811 | encoded_bytes = base64.b64encode(text.encode("utf-8")) |
| 812 | encoded_str = encoded_bytes.decode("utf-8") |
| 813 | return f"=?utf-8?B?{encoded_str}?=" |
| 814 | |
| 815 | if not push_config.get("NTFY_TOPIC"): |
| 816 | return |