# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 2018-02-13 04:51:18
# Node ID 6df206ef4b10bee0453654ce77cbef3cfda53797
# Parent  42a393ea56d2d8e8280a0e803cb3dbddd4a4cd97

convcmd: pass encoding name as a sysstr

Differential Revision: https://phab.mercurial-scm.org/D2221

diff --git a/hgext/convert/convcmd.py b/hgext/convert/convcmd.py
--- a/hgext/convert/convcmd.py
+++ b/hgext/convert/convcmd.py
@@ -16,6 +16,7 @@ from mercurial import (
     encoding,
     error,
     hg,
+    pycompat,
     scmutil,
     util,
 )
@@ -55,9 +56,10 @@ orig_encoding = 'ascii'
 
 def recode(s):
     if isinstance(s, unicode):
-        return s.encode(orig_encoding, 'replace')
+        return s.encode(pycompat.sysstr(orig_encoding), 'replace')
     else:
-        return s.decode('utf-8').encode(orig_encoding, 'replace')
+        return s.decode('utf-8').encode(
+            pycompat.sysstr(orig_encoding), 'replace')
 
 def mapbranch(branch, branchmap):
     '''