# HG changeset patch # User Brendan Cully # Date 1153442177 -7200 # Node ID 3b53fa20dda8651241298958cdf2af509d050c57 # Parent f47432ae5376026970c8cbcf1a7d96c2bf3ddf9d Preserve multibyte UTF-8 characters when obfuscating. This version uses the unicode 'replace' option, so non-UTF-8 encodings will still be mangled. Luckily, there aren't any of those. diff --git a/mercurial/templater.py b/mercurial/templater.py --- a/mercurial/templater.py +++ b/mercurial/templater.py @@ -241,6 +241,7 @@ def nl2br(text): return text.replace('\n', '
\n') def obfuscate(text): + text = unicode(text, 'utf-8', 'replace') return ''.join(['&#%d;' % ord(c) for c in text]) def domain(author):