feat: add docstring, specific encoding.

This commit is contained in:
CronyAkatsuki 2025-12-21 09:27:10 +01:00
parent 053ff7dc06
commit 0ab67b9864

View file

@ -1,5 +1,9 @@
#!/usr/bin/env python
"""
Extracts description from datalist
"""
import os
import sys
import xml.etree.ElementTree as ET
@ -12,5 +16,5 @@ for game in root.findall("game"):
textFile = os.path.splitext(f"{romName}")[0] + ".txt"
os.makedirs("text", exist_ok=True)
with open(f"text/{textFile}", "w") as f:
with open(f"text/{textFile}", "w", encoding="utf-8") as f:
f.write(game.find("description").text)