comparison mercurial/templater.py @ 3904:0dd07dd63db3

templater.py: fix obfuscate
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Sat, 16 Dec 2006 02:21:46 -0200
parents 734e337cb816
children 1063a631cb8e 66a3fe30f9fc
comparison
equal deleted inserted replaced
3901:733d56b8830f 3904:0dd07dd63db3
202 def nl2br(text): 202 def nl2br(text):
203 '''replace raw newlines with xhtml line breaks.''' 203 '''replace raw newlines with xhtml line breaks.'''
204 return text.replace('\n', '<br/>\n') 204 return text.replace('\n', '<br/>\n')
205 205
206 def obfuscate(text): 206 def obfuscate(text):
207 text = unicode(text, 'utf-8', 'replace') 207 text = unicode(text, util._encoding, 'replace')
208 return ''.join(['&#%d;' % ord(c) for c in text]) 208 return ''.join(['&#%d;' % ord(c) for c in text])
209 209
210 def domain(author): 210 def domain(author):
211 '''get domain of author, or empty string if none.''' 211 '''get domain of author, or empty string if none.'''
212 f = author.find('@') 212 f = author.find('@')