def set_subject(self):
		import email.header
		_subject = email.header.decode_header(self.mail.get("Subject", "No Subject"))
		self.subject = _subject[0][0] or ""
		if _subject[0][1]:
			self.subject = self.subject.decode(_subject[0][1])
		else:
			# assume that the encoding is utf-8
			self.subject = self.subject.decode("utf-8")

		if not self.subject:
			self.subject = "No Subject"
Parse and decode `Subject` header.
dataset/ETHPy150Open frappe/frappe/frappe/email/receive.py/Email.set_subject