Skip to content

Commit 3ea51fa

Browse files
authored
gh-123994: Generate utf-16 file using little endian and BOM. (#123995)
1 parent a362c41 commit 3ea51fa

File tree

1 file changed

+2
-2
lines changed
  • Lib/test/test_importlib/resources

1 file changed

+2
-2
lines changed

Lib/test/test_importlib/resources/util.py

+2-2
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)