В настоящее время я использую 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 =
-
Иногда он действует как escape-метка, подобная "%", например:
a=20b
на самом делеa<SPACE>b
=46rom here
на самом делеFrom here
Меня совершенно путают такие странные обозначения. Я думаю, что должно быть руководство, чтобы справиться с этим, потому что GMail может правильно обрабатывать такие вещи в своих приложениях.
Я вижу, что это связано с кодировкой HTML, так же как и "%". Но проблема в том, что все, что я получаю от ответа IMAP, это строка, содержащая этот символ "=". Как я должен справиться с этим? Используя регулярное выражение?