utf-8 和 utf-8-sig 有什么区别? [英] What is the difference between utf-8 and utf-8-sig?

查看:104
本文介绍了utf-8 和 utf-8-sig 有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 Pandas 数据帧在 python 中编码孟加拉语单词.但是作为编码类型,utf-8 不起作用但 utf-8-sig 起作用.我知道 utf-8-sig 带有 BOM(字节顺序标记).但是为什么这被称为 utf-8-sig 以及它是如何工作的?

I am trying to encode Bangla words in python using pandas dataframe. But as encoding type, utf-8 is not working but utf-8-sig is. I know utf-8-sig is with BOM(Byte order mark). But why is this called utf-8-sig and how it works?

推荐答案

"sig"在utf-8-sig"中是signature"的缩写(即签名 utf-8 文件).使用 utf-8-sig 读取文件会将 BOM 视为文件信息.而不是字符串.

"sig" in "utf-8-sig" is the abbreviation of "signature" (i.e. signature utf-8 file). Using utf-8-sig to read a file will treat BOM as file info. instead of a string.

这篇关于utf-8 和 utf-8-sig 有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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