检测字符集并在Python中转换为utf-8? [英] Detect charset and convert to utf-8 in Python?

查看:186
本文介绍了检测字符集并在Python中转换为utf-8?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有检测字符串字符集的通用方法?我使用IPTC标签,并且没有已知的编码.我需要检测它,然后将其更改为utf-8.

Is there any universal method to detect string charset? I user IPTC tags and have no known encoding. I need to detect it and then change them to utf-8.

有人可以帮忙吗?

推荐答案

您要使用 chardet ,编码检测器

You want to use chardet, an encoding detector

这篇关于检测字符集并在Python中转换为utf-8?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆