--- encoding.old.py	2017-08-20 09:37:59 +0000
+++ encoding.py	2017-08-20 09:26:03 +0000
@@ -121,7 +121,7 @@
         if encoding == 'utf-8':
             return s
         else:
-            return s.decode('utf-8', errors).encode(encoding, errors)
+            return s.decode(encoding, errors).encode('utf-8', errors)
     if strings_only and is_protected_type(s):
         return s
     if isinstance(s, six.memoryview):
