mirror of
https://gitlab.com/kelteseth/ScreenPlay.git
synced 2024-09-18 08:22:33 +02:00
19 lines
684 B
Python
19 lines
684 B
Python
|
import json
|
||
|
import os
|
||
|
|
||
|
# open all files in subfolder public and convert to utf8
|
||
|
for root, dirs, files in os.walk("public/steam"):
|
||
|
for file in files:
|
||
|
if file.endswith(".h"):
|
||
|
path = os.path.join(root, file)
|
||
|
data = ""
|
||
|
try:
|
||
|
with open(path, 'r', encoding='utf-8', errors='strict') as f:
|
||
|
data = f.read()
|
||
|
except UnicodeDecodeError:
|
||
|
print("Converting " + file)
|
||
|
with open(path, 'r', encoding='cp1252') as infile:
|
||
|
data = infile.read()
|
||
|
with open(path, 'w', encoding='utf-8') as outfile:
|
||
|
outfile.write(data)
|