From: Oleg Broytman Date: Sun, 8 Jun 2014 16:56:09 +0000 (+0400) Subject: Encode unicode to utf-8 X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=a65664bfcb76814a750b6dd6e1f38974bcee22be;p=phdru.name%2Fphdru.name.git Encode unicode to utf-8 --- diff --git a/phd.py b/phd.py index d1821b1..52f6937 100644 --- a/phd.py +++ b/phd.py @@ -54,6 +54,8 @@ class phd(Template): new_paras = [] for p in paragraphs: + if isinstance(p, unicode): + p = p.encode('utf-8') parts = p.split("\n ") parts[0] = parts[0].strip() new_paras.append('\n

\n

\n'.join(parts))