# -*- coding: utf-8 -*- with open('dungeons/index.html', 'rb') as f: text = f.read().decode('utf-8') # ハラタリ修練所 (Hard) を準備中に戻す text = text.replace( 'ハラタリ修練所 (Hard)\r\n Lv50 (IL55〜)\r\n 非対応\r\n 剣闘士コロシアム、百裂拳、マンティコア。\r\n 攻略を見る ➜', 'ハラタリ修練所 (Hard)\r\n Lv50 (IL55〜)\r\n 非対応\r\n 剣闘士コロシアム、百裂拳、マンティコア。\r\n 準備中' ) # LF環境のフォールバック text = text.replace( 'ハラタリ修練所 (Hard)\n Lv50 (IL55〜)\n 非対応\n 剣闘士コロシアム、百裂拳、マンティコア。\n 攻略を見る ➜', 'ハラタリ修練所 (Hard)\n Lv50 (IL55〜)\n 非対応\n 剣闘士コロシアム、百裂拳、マンティコア。\n 準備中' ) # BOM付きUTF-8 + CRLFで保存 text = text.replace('\r\n', '\n').replace('\r', '\n') lines = [l.rstrip() for l in text.split('\n')] res = '\r\n'.join(lines) + '\r\n' res = res.lstrip('\ufeff') with open('dungeons/index.html', 'wb') as f: f.write(b'\xef\xbb\xbf' + res.encode('utf-8')) print("Fixed Hard link")