您的位置:首页 > 其它

去除(UTF-8)格式文本中的Bom

2012-12-12 17:35 405 查看
def trimFile(name):
file = open(name,'rb')
content = file.read(3)
if content != '\xEF\xBB\xBF':
return False
content = file.read()
file.close()
file = open(name,'wb')
file.write(content)
file.close
print 'convert ',name,' finish'
return True
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: