Preserve multibyte UTF-8 characters when obfuscating.
authorBrendan Cully <brendan@kublai.com>
Fri, 21 Jul 2006 02:36:17 +0200
changeset 2649 3b53fa20dda8
parent 2648 f47432ae5376
child 2650 56e98084e040
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.
mercurial/templater.py
--- a/mercurial/templater.py	Fri Jul 21 02:31:59 2006 +0200
+++ b/mercurial/templater.py	Fri Jul 21 02:36:17 2006 +0200
@@ -241,6 +241,7 @@
     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):