with open(file_path, 'w', encoding='utf-8') as utf8_file:utf8_file.write(decoded_data)print(f"已将 {file_path} 从 GB2312 转换为 UTF-8")else:print(f"跳过 {file_path},因为编码不是 GB2312")def convert_rules_txt_to_utf8(folder_path):for root, _, files in os.walk(folder_...
QAQ 二、源代码 importtkinterastkfromtkinterimportfiledialogimportosimportcodecsdefbrowse_folder():folder_path=filedialog.askdirectory()entry.delete(0,tk.END)entry.insert(0,folder_path)defconvert_files_to_ansi():folder_path=entry.get()forroot,dirs,filesinos.walk(folder_path):forfileinfiles:iffile.e...