使用python的chardet库获得文件编码并修改编码
                                首先需要安装chardet库,有很多方式,我才用的是比较笨的方式:sudo pip install chardet 复制代码 代码如下:#!/usr/bin/env python# coding: UTF-8import sysimport osimport chardet def print_usage():  print ”’usage:  change_charset [file|directory] [charset] [output file]\n  for example:    change 1.txt utf-8 n1.txt    change 1.txt utf-8                            
                            
                            
                            
                        
                            下载地址
                        
                    
                            用户评论
                        
                    