编码,java,utf-8,gbk

  try {
			ZipOutputStream out = new ZipOutputStream(new FileOutputStream(fileName));
			out.setEncoding("UTF-8");
			for (File f:files) {
				String name = f.getName();
				if(f instanceof CustomFile){
					CustomFile cf  = (CustomFile) f;
					name = cf.getTitleName();
					
				}

out.setEncoding("UTF-8");

做文件压缩时,注意红色这行,由于文件名是从数据库utf-8编码读出来的,解压文件发现乱码,只要设置这行就行了,走了很多弯路啊!!!

你可能感兴趣的:(java,F#)