Skip to content

Commit

Permalink
Merge pull request #358 from transifex/TX-15941_parse_file_with_bom_i…
Browse files Browse the repository at this point in the history
…n_rels

Remove BOM (Byte Order Mark) bytes from .rels file
  • Loading branch information
arisktfx authored Dec 4, 2024
2 parents 9b4fdee + 74646b2 commit 06c0bdb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions openformats/formats/docx.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ def __init__(self, content):
base_rels_path = '{}/{}'.format(self.__tmp_folder, '_rels/.rels')
with io.open(base_rels_path, 'r') as f:
base_rels = f.read()

if base_rels.startswith("\ufeff"):
# Remove BOM
base_rels = base_rels.replace("\ufeff", "")

document_relative_path = next((
relationship
Expand Down

0 comments on commit 06c0bdb

Please sign in to comment.