Spaces:
Sleeping
Sleeping
| path = r"c:\Users\trios\.gemini\antigravity\vscode\loveca-copy\engine\game\mixins\effect_mixin.py" with open(path, "rb") as f: content = f.read() # Try to decode as shift-jis or utf-8 try: text = content.decode("shift-jis") except: try: text = content.decode("utf-8") except: text = content.decode("utf-8", errors="replace") # Specific Mojibake replacements using escapes to be safe # �����D��? = \u8334\u4f55\u304c\u8702\u3059\u304f\uff1f (Wait, these are actually corrupted utf-8 bytes read as something else) # Let's just strip non-ascii from lines that cause syntax errors # OR use the exact bytes. # Actually, the easiest way to fix the syntax error at 534 is to find the line: # group_str = cond.params.get("group", "").strip("?u?v") # but "?u?v" was mangled. lines = text.splitlines() new_lines = [] for line in lines: # Rule of thumb: if line has broken japanese, it's probably comments or strings we can reconstruct if 'strip("' in line and '")' in line: # Fix the strip("?u?v") line specifically if 'cond.params.get("group"' in line: new_lines.append(line.split("strip(")[0] + 'strip("\u300c\u300d")') continue # Generic fix: if line contains characters outside common range and it's a known problematic line # (Checking against the view_file output) if 'if "?????D??' in line or 'if "' in line and 'params.get("text"' in line: # This was part of the FLAVOR_ACTION which I tried to remove, let's just make sure it's clean continue new_lines.append(line) with open(path, "w", encoding="utf-8") as f: f.write("\n".join(new_lines)) print("Script completed reconstruction.") |