Skip to content

Commit becc253

Browse files
committed
Fix encoding issues.
Resolves datacontract#712
1 parent d9e0c1b commit becc253

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

datacontract/catalog/catalog.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def create_data_contract_html(contracts, file: Path, path: Path, schema: str):
1919
file_without_suffix = file.with_suffix(".html")
2020
html_filepath = path / file_without_suffix
2121
html_filepath.parent.mkdir(parents=True, exist_ok=True)
22-
with open(html_filepath, "w") as f:
22+
with open(html_filepath, "w", encoding="utf-8") as f:
2323
f.write(html)
2424
contracts.append(
2525
DataContractView(
@@ -42,7 +42,7 @@ class DataContractView:
4242

4343
def create_index_html(contracts, path):
4444
index_filepath = path / "index.html"
45-
with open(index_filepath, "w") as f:
45+
with open(index_filepath, "w", encoding="utf-8") as f:
4646
# Load templates from templates folder
4747
package_loader = PackageLoader("datacontract", "templates")
4848
env = Environment(

datacontract/templates/datacontract.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,8 @@ <h3 class="text-base font-semibold leading-6 text-gray-900" id="modal-title">Dat
283283
</div>
284284
<div class="mt-8 md:order-1 md:mt-0">
285285
<p class="text-center leading-5 text-gray-400">
286-
Supported with ❤️ by <a href="https://datacontract-manager.com" class="text-gray-400 hover:text-gray-500">Data Contract Manager</a>
286+
Supported by <a href="https://datacontract-manager.com"
287+
class="text-gray-400 hover:text-gray-500">Data Contract Manager</a>
287288
</p>
288289
</div>
289290
</div>

datacontract/templates/index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,8 @@ <h3 class="text-base font-semibold leading-6 text-gray-900" id="modal-title">Dat
190190
</div>
191191
<div class="mt-8 md:order-1 md:mt-0">
192192
<p class="text-center leading-5 text-gray-400">
193-
Supported with ❤️ by <a href="https://datacontract-manager.com" class="text-gray-400 hover:text-gray-500">Data Contract Manager</a>
193+
Supported by <a href="https://datacontract-manager.com"
194+
class="text-gray-400 hover:text-gray-500">Data Contract Manager</a>
194195
</p>
195196
</div>
196197
</div>

tests/fixtures/export/datacontract.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2474,7 +2474,8 @@ <h3 class="text-base font-semibold leading-6 text-gray-900" id="modal-title">Dat
24742474
</div>
24752475
<div class="mt-8 md:order-1 md:mt-0">
24762476
<p class="text-center leading-5 text-gray-400">
2477-
Supported with ❤️ by <a href="https://datacontract-manager.com" class="text-gray-400 hover:text-gray-500">Data Contract Manager</a>
2477+
Supported by <a href="https://datacontract-manager.com"
2478+
class="text-gray-400 hover:text-gray-500">Data Contract Manager</a>
24782479
</p>
24792480
</div>
24802481
</div>

0 commit comments

Comments
 (0)