Mercurial > public > mercurial-scm > hg
comparison mercurial/templatefilters.py @ 36563:9d71bd25554b
templatefilters: convert arguments to sysstrs for unicode() ctor
Differential Revision: https://phab.mercurial-scm.org/D2538
author | Augie Fackler <augie@google.com> |
---|---|
date | Thu, 01 Mar 2018 20:44:38 -0500 |
parents | a185b1af207c |
children | 9b6b02a5b589 |
comparison
equal
deleted
inserted
replaced
36562:247e9bf4ecdc | 36563:9d71bd25554b |
---|---|
271 @templatefilter('obfuscate') | 271 @templatefilter('obfuscate') |
272 def obfuscate(text): | 272 def obfuscate(text): |
273 """Any text. Returns the input text rendered as a sequence of | 273 """Any text. Returns the input text rendered as a sequence of |
274 XML entities. | 274 XML entities. |
275 """ | 275 """ |
276 text = unicode(text, encoding.encoding, 'replace') | 276 text = unicode(text, pycompat.sysstr(encoding.encoding), r'replace') |
277 return ''.join(['&#%d;' % ord(c) for c in text]) | 277 return ''.join(['&#%d;' % ord(c) for c in text]) |
278 | 278 |
279 @templatefilter('permissions') | 279 @templatefilter('permissions') |
280 def permissions(flags): | 280 def permissions(flags): |
281 if "l" in flags: | 281 if "l" in flags: |