We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9fc8937 commit 5639f3dCopy full SHA for 5639f3d
src/dinglehopper/tests/test_ocr_files.py
@@ -182,3 +182,15 @@ def test_plain(tmp_path):
182
result = plain_text("ocr.txt")
183
expected = "First, a line.\nAnd a second line."
184
assert result == expected
185
+
186
187
+def test_plain_BOM(tmp_path):
188
+ """Test that plain text files with BOM are read correctly."""
189
+ BOM = "\ufeff"
190
+ with working_directory(tmp_path):
191
+ with open("ocr.txt", "w") as ocrf:
192
+ ocrf.write(BOM + "First, a line.\nAnd a second line.\n")
193
194
+ result = plain_text("ocr.txt")
195
+ expected = "First, a line.\nAnd a second line."
196
+ assert result == expected
0 commit comments