MCPcopy Index your code
hub / github.com/clips/pattern / _decode

Function _decode

pattern/web/imap/__init__.py:178–191  ·  view source on GitHub ↗
(s, message)

Source from the content-addressed store, hash-verified

176#--- MAIL FOLDER -----------------------------------------------------------------------------------
177
178def _decode(s, message):
179 try:
180 # Decode message Content-Type charset to Unicode.
181 # If all fails, try Latin-1 (common case).
182 e = message.get("Content-Type")
183 e = e.split("charset=")[-1].split(";")[0].strip("\"'").lower()
184 s = s.decode(e)
185 except:
186 try: s = s.decode("utf-8")
187 except:
188 try: s = s.decode("latin-1")
189 except:
190 pass
191 return s
192
193class MailFolder(object):
194

Callers 1

__getitem__Method · 0.85

Calls 4

stripMethod · 0.80
getMethod · 0.45
splitMethod · 0.45
decodeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…