我目前正在使用Python imaplib来处理电子邮件文本.
我使用fetch命令从GMail服务器获取原始数据电子邮件.但是,我发现有一件事很棘手 - 等号'='.它不是正常的等号,而是一个特殊的符号.
例如:
'='有时用作文本行末尾的连字符标记:
Depending upon your module selections, course lecturers may also contact yo=
u with preparatory work over the next few weeks. It would be wise to start =
reviewing the preparatory reading lists provided on the module syllabi now =
Run Code Online (Sandbox Code Playgroud)有时,它充当类似'%'的转义标记,例如:
a=20b实际上实际上a<SPACE>b
=46rom here是From here
我对这种奇怪的符号感到困惑.我认为必须有一个指导来处理这个,因为GMail可以在他们的应用程序中正确处理这样的事情.
我发现这与HTML编码有关,就像'%'将被编码一样.但问题是,我从IMAP响应得到的只是一个包含这个'='符号的字符串.我该怎么处理?使用正则表达式?