This commit is contained in:
2026-01-30 11:28:35 +08:00
commit f1831c31b4
399 changed files with 860978 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
file_path = r"C:\Users\Administrator.DESKTOP-7IC2USJ\Desktop\ARMASTลูกค้า 3.txt"
output_file_path = r"C:\Users\Administrator.DESKTOP-7IC2USJ\Desktop\ARMASTลูกค้า 215415.txt"
# 使用TIS-620编码读取文件,并处理可能的编码错误
with open(file_path, 'r', encoding='TIS-620', errors='replace') as file:
content = file.read()
# 直接将内容写入新的UTF-8编码文件
with open(output_file_path, 'w', encoding='UTF-8') as output_file:
output_file.write(content)
print(f"File has been converted and saved to {output_file_path}")