changeset 2643:3b53fa20dda8

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.
author Brendan Cully <brendan@kublai.com>
date Fri, 21 Jul 2006 02:36:17 +0200
parents f47432ae5376
children 56e98084e040
files mercurial/templater.py
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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):