equal
deleted
inserted
replaced
370 @templatefilter(b'obfuscate', intype=bytes) |
370 @templatefilter(b'obfuscate', intype=bytes) |
371 def obfuscate(text): |
371 def obfuscate(text): |
372 """Any text. Returns the input text rendered as a sequence of |
372 """Any text. Returns the input text rendered as a sequence of |
373 XML entities. |
373 XML entities. |
374 """ |
374 """ |
375 text = pycompat.unicode( |
375 text = str(text, pycompat.sysstr(encoding.encoding), r'replace') |
376 text, pycompat.sysstr(encoding.encoding), r'replace' |
|
377 ) |
|
378 return b''.join([b'&#%d;' % ord(c) for c in text]) |
376 return b''.join([b'&#%d;' % ord(c) for c in text]) |
379 |
377 |
380 |
378 |
381 @templatefilter(b'permissions', intype=bytes) |
379 @templatefilter(b'permissions', intype=bytes) |
382 def permissions(flags): |
380 def permissions(flags): |