from chardet import detect as char_detect
def change_encode_type(file_path, des='utf-8'):
# 获取原文本的编码类型
with open(file_path, 'rb') as f:
detect_result =
【python小工具】chardet.detect 检测、转换文本编码
最新推荐文章于 2025-03-23 10:47:12 发布