Skip to content

Commit 313bed2

Browse files
committed
gh-123994: Generate utf-16 file using little endian and BOM. (#123995)
1 parent c00a2b7 commit 313bed2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

importlib_resources/tests/util.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def test_useless_loader(self):
145145
data01={
146146
'__init__.py': '',
147147
'binary.file': bytes(range(4)),
148-
'utf-16.file': 'Hello, UTF-16 world!\n'.encode('utf-16'),
148+
'utf-16.file': '\ufeffHello, UTF-16 world!\n'.encode('utf-16-le'),
149149
'utf-8.file': 'Hello, UTF-8 world!\n'.encode('utf-8'),
150150
'subdirectory': {
151151
'__init__.py': '',
@@ -160,7 +160,7 @@ def test_useless_loader(self):
160160
},
161161
namespacedata01={
162162
'binary.file': bytes(range(4)),
163-
'utf-16.file': 'Hello, UTF-16 world!\n'.encode('utf-16'),
163+
'utf-16.file': '\ufeffHello, UTF-16 world!\n'.encode('utf-16-le'),
164164
'utf-8.file': 'Hello, UTF-8 world!\n'.encode('utf-8'),
165165
'subdirectory': {
166166
'binary.file': bytes(range(12, 16)),

0 commit comments

Comments
 (0)