#21804: Add RFC 6856 (UTF8) support to poplib.
Patch by Milan Oberkirch.
diff --git a/Lib/poplib.py b/Lib/poplib.py
index 4915628..f672390 100644
--- a/Lib/poplib.py
+++ b/Lib/poplib.py
@@ -71,6 +71,7 @@
UIDL [msg] uidl(msg = None)
CAPA capa()
STLS stls()
+ UTF8 utf8()
Raises one exception: 'error_proto'.
@@ -348,6 +349,12 @@
return self._longcmd('UIDL')
+ def utf8(self):
+ """Try to enter UTF-8 mode (see RFC 6856). Returns server response.
+ """
+ return self._shortcmd('UTF8')
+
+
def capa(self):
"""Return server capabilities (RFC 2449) as a dictionary
>>> c=poplib.POP3('localhost')