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
在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.