--- a/mercurial/templater.py
+++ b/mercurial/templater.py
@@ -241,6 +241,7 @@ def nl2br(text):
return text.replace('\n', '<br/>\n')
def obfuscate(text):
+ text = unicode(text, 'utf-8', 'replace')
return ''.join(['&#%d;' % ord(c) for c in text])
def domain(author):