]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-123994: Generate utf-16 file using little endian and BOM. (#123995)
authorJason R. Coombs <jaraco@jaraco.com>
Thu, 12 Sep 2024 14:14:46 +0000 (10:14 -0400)
committerGitHub <noreply@github.com>
Thu, 12 Sep 2024 14:14:46 +0000 (10:14 -0400)
Lib/test/test_importlib/resources/util.py

index 893dda691191924ccdc4b0bbe59b0176fa92f9b9..e2d995f596317d00eff850dec90b77467d08be85 100644 (file)
@@ -145,7 +145,7 @@ fixtures = dict(
     data01={
         '__init__.py': '',
         'binary.file': bytes(range(4)),
-        'utf-16.file': 'Hello, UTF-16 world!\n'.encode('utf-16'),
+        'utf-16.file': '\ufeffHello, UTF-16 world!\n'.encode('utf-16-le'),
         'utf-8.file': 'Hello, UTF-8 world!\n'.encode('utf-8'),
         'subdirectory': {
             '__init__.py': '',
@@ -160,7 +160,7 @@ fixtures = dict(
     },
     namespacedata01={
         'binary.file': bytes(range(4)),
-        'utf-16.file': 'Hello, UTF-16 world!\n'.encode('utf-16'),
+        'utf-16.file': '\ufeffHello, UTF-16 world!\n'.encode('utf-16-le'),
         'utf-8.file': 'Hello, UTF-8 world!\n'.encode('utf-8'),
         'subdirectory': {
             'binary.file': bytes(range(12, 16)),