1.查看文件编码方式--file 文件名(但不是很准确) yang@mint-linux ~ $ file baidu.html baidu.html: HTML document, UTF-8 Unicode text, with very long lines, with no line terminators yang@mint-linux ~ $ file sina.html sina.html: HTML document, ISO-8859 text, with very long
Windows的默认编码为GBK,Linux的默认编码为UTF-8.在Windows下编辑的中文,在Linux下显示为乱码.一种方法是在windows进行转码,比如使用ue工具在文件-->转换 进行转码,或者使用记事本另存为方法,还有一种方法修改Linux的默认编码为GBK.方法如下: 方法1: vi /etc/sysconfig/i18n 默认为: LANG="en_US.UTF-8"SYSFONT="latarcyrheb-sun16" 修改为: LA
在python中编程导入压缩包,利用zipfile包,从zipinfo读取文件名总是出错,创建的文件名是乱码,写入pgsql更是出错. 但在ubuntu下测试却正常,在windows下测试总是失败. if not hdfs.exists_file_dir(dir): hdfs.make_dir(dir) hdfs.create_file(hpath, zip.read(info)) # There is no official file name encoding for ZIP files.