Skip to content

Commit 06c0bdb

Browse files
authored
Merge pull request #358 from transifex/TX-15941_parse_file_with_bom_in_rels
Remove BOM (Byte Order Mark) bytes from .rels file
2 parents 9b4fdee + 74646b2 commit 06c0bdb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

openformats/formats/docx.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,10 @@ def __init__(self, content):
103103
base_rels_path = '{}/{}'.format(self.__tmp_folder, '_rels/.rels')
104104
with io.open(base_rels_path, 'r') as f:
105105
base_rels = f.read()
106+
107+
if base_rels.startswith("\ufeff"):
108+
# Remove BOM
109+
base_rels = base_rels.replace("\ufeff", "")
106110

107111
document_relative_path = next((
108112
relationship

0 commit comments

Comments
 (0)