Add native Windows compatibility layer

This commit is contained in:
pewdiepie-archdaemon
2026-06-01 15:09:47 +09:00
parent ead7c01822
commit 0888a3b3e6
54 changed files with 1104 additions and 267 deletions

View File

@@ -75,7 +75,7 @@ Use precise language. Show causal relationships explicitly. Quantify uncertainty
return self.DEFAULT_PRESETS.copy()
try:
with open(self.presets_file, 'r') as f:
with open(self.presets_file, 'r', encoding="utf-8") as f:
presets = json.load(f)
custom = presets.get("custom") if isinstance(presets, dict) else None
if isinstance(custom, dict) and "enabled" not in custom:
@@ -101,7 +101,7 @@ Use precise language. Show causal relationships explicitly. Quantify uncertainty
"""Save presets to file"""
try:
os.makedirs(os.path.dirname(self.presets_file), exist_ok=True)
with open(self.presets_file, 'w') as f:
with open(self.presets_file, 'w', encoding="utf-8") as f:
json.dump(presets, f, indent=2)
self.presets = presets
return True