1
0
mirror of synced 2025-02-03 13:13:26 +01:00

parsers.py: Add support for SHIFT-JIS .tjas

Roppon was formatted as SHIFTJIS, so this was necessary.
This commit is contained in:
Viv 2023-06-02 16:35:06 -04:00
parent 3e2e29baa1
commit a510696efc

View File

@ -24,8 +24,12 @@ def main(fnameFumen=None, fnameTJA=None, validate=False):
if fnameTJA:
# Parse tja
try:
inputFile = open(fnameTJA, "r", encoding="utf-8-sig")
parsedSongsTJA = parseTJA(inputFile)
except UnicodeDecodeError:
inputFile = open(fnameTJA, "r", encoding="shift-jis")
parsedSongsTJA = parseTJA(inputFile)
# Try converting the Oni TJA chart to match the Oni fumen
convertedTJA = convertTJAToFumen(parsedSongFumen, parsedSongsTJA['Oni'])