From c9d7afac4f1396b6e632277b39fea816b974131e Mon Sep 17 00:00:00 2001 From: Markus Krogh Date: Mon, 14 Mar 2016 09:57:28 +0000 Subject: Support ISO-8859-1 and utf8 --- maconomy/mailer.py | 2 +- maconomy/models.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/maconomy/mailer.py b/maconomy/mailer.py index 4f4070f..28a2d53 100644 --- a/maconomy/mailer.py +++ b/maconomy/mailer.py @@ -8,7 +8,7 @@ class Mailer: self.server = smtplib.SMTP(server_addr) def send(self, to, subject, body): - msg = MIMEText(body,'html') + msg = MIMEText(body,'html', _charset='utf8') msg['To']=to msg['From']=self.me msg['Subject'] = subject diff --git a/maconomy/models.py b/maconomy/models.py index 14629ca..f878172 100644 --- a/maconomy/models.py +++ b/maconomy/models.py @@ -11,7 +11,7 @@ class Employee: return cls(id, name, email) def __unicode__(self): - return u"{} ({})".format(self.name, self.id) + return u"{} ({})".format(unicode(self.name,"ISO-8859-1"), self.id) class Timesheet: -- cgit v1.1