]> git.phdru.name Git - phdru.name/phdru.name.git/commitdiff
Encode unicode to utf-8
authorOleg Broytman <phd@phdru.name>
Sun, 8 Jun 2014 16:56:09 +0000 (20:56 +0400)
committerOleg Broytman <phd@phdru.name>
Wed, 23 Dec 2015 15:54:09 +0000 (18:54 +0300)
phd.py

diff --git a/phd.py b/phd.py
index d1821b1abcc93beed7d6b5bcdedccbacc2c623a3..52f69370b61c4e932405eb8c170d2fb402255789 100644 (file)
--- 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</p>\n<p>\n'.join(parts))