diff --color -Naur conda-4.10.3.orig/conda/core/portability.py conda-4.10.3/conda/core/portability.py
--- conda-4.10.3.orig/conda/core/portability.py	2021-06-29 23:30:51.000000000 -0300
+++ conda-4.10.3/conda/core/portability.py	2021-09-09 16:15:55.872345749 -0300
@@ -3,6 +3,10 @@
 # SPDX-License-Identifier: BSD-3-Clause
 from __future__ import absolute_import, division, print_function, unicode_literals
 
+# force encodings to be available when updating python.
+# xref.: https://github.com/conda-forge/conda-feedstock/pull/135
+from encodings import utf_8, utf_16, utf_16_le, utf_16_be, utf_32, utf_32_le, utf_32_be
+
 from logging import getLogger
 from os.path import realpath
 import re
@@ -68,21 +72,40 @@
 
 
 def replace_prefix(mode, data, placeholder, new_prefix):
-    if mode == FileMode.text:
-        data = data.replace(placeholder.encode('utf-8'), new_prefix.encode('utf-8'))
-    elif mode == FileMode.binary:
-        data = binary_replace(data, placeholder.encode('utf-8'), new_prefix.encode('utf-8'))
-    else:
-        raise CondaIOError("Invalid mode: %r" % mode)
+    popular_encodings = [
+        'utf-8',
+        # Make sure to specify -le and -be so that the UTF endian prefix
+        # doesn't show up in the string
+        'utf-16-le', 'utf-16-be',
+        'utf-32-le', 'utf-32-be'
+    ]
+    for encoding in popular_encodings:
+        if mode == FileMode.text:
+            data = data.replace(placeholder.encode(encoding),
+                                new_prefix.encode(encoding))
+        elif mode == FileMode.binary:
+            data = binary_replace(data,
+                                  placeholder.encode(encoding),
+                                  new_prefix.encode(encoding),
+                                  encoding=encoding)
+        else:
+            raise CondaIOError("Invalid mode: %r" % mode)
     return data
 
 
-def binary_replace(data, a, b):
+def binary_replace(data, a, b, encoding='utf-8'):
     """
     Perform a binary replacement of `data`, where the placeholder `a` is
     replaced with `b` and the remaining string is padded with null characters.
     All input arguments are expected to be bytes objects.
+
+
+    Parameters
+    ----------
+    encoding: str
+        The encoding of the expected string in the binary.
     """
+    zeros = '\0'.encode(encoding)
     if on_win:
         # on Windows for binary files, we currently only replace a pyzzer-type entry point
         #   we skip all other prefix replacement
@@ -99,7 +122,10 @@
         return match.group().replace(a, b) + b'\0' * padding
 
     original_data_len = len(data)
-    pat = re.compile(re.escape(a) + b'([^\0]*?)\0')
+    pat = re.compile(
+        re.escape(a) +
+        b'(?:(?!(?:' + zeros + b')).)*' + zeros
+    )
     data = pat.sub(replace, data)
     assert len(data) == original_data_len
 
diff --color -Naur conda-4.10.3.orig/tests/test_install.py conda-4.10.3/tests/test_install.py
--- conda-4.10.3.orig/tests/test_install.py	2021-06-29 23:30:51.000000000 -0300
+++ conda-4.10.3/tests/test_install.py	2021-09-09 16:16:53.941678976 -0300
@@ -34,9 +34,14 @@
 
     @pytest.mark.xfail(on_win, reason="binary replacement on windows skipped", strict=True)
     def test_simple(self):
-        self.assertEqual(
-            binary_replace(b'xxxaaaaaxyz\x00zz', b'aaaaa', b'bbbbb'),
-            b'xxxbbbbbxyz\x00zz')
+        for encoding in ['utf-8', 'utf-16-le', 'utf-16-be', 'utf-32-le', 'utf-32-be']:
+            a = 'aaaaa'.encode(encoding)
+            b = 'bbbb'.encode(encoding)
+            data   = 'xxxaaaaaxyz\0zz'.encode(encoding)
+            result = 'xxxbbbbxyz\0\0zz'.encode(encoding)
+            self.assertEqual(
+                binary_replace(data, a, b, encoding=encoding),
+                result)
 
     @pytest.mark.xfail(on_win, reason="binary replacement on windows skipped", strict=True)
     def test_shorter(self):
