changeset 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 247e9bf4ecdc
children c4ccc73f9d49
files mercurial/templatefilters.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/templatefilters.py	Fri Mar 02 07:14:59 2018 +0530
+++ b/mercurial/templatefilters.py	Thu Mar 01 20:44:38 2018 -0500
@@ -273,7 +273,7 @@
     """Any text. Returns the input text rendered as a sequence of
     XML entities.
     """
-    text = unicode(text, encoding.encoding, 'replace')
+    text = unicode(text, pycompat.sysstr(encoding.encoding), r'replace')
     return ''.join(['&#%d;' % ord(c) for c in text])
 
 @templatefilter('permissions')