时间:2018-7-31
现象:项目在本地启动下载文件压缩后,没有出现乱码问题,但在docker容器中部署项目后,写出文件压缩后中文乱码
解决过程: 首先在代码中尝试了多种写出方法。因为有文件需要压缩,使用最java自带工具类java.util.zip,出现了乱码(乱码为???)。此时想到的肯定是自己java编码压缩有问题,然后又换成了org.apache.tools.zip还是乱码,那我就想了啊,是不是在压缩前生成文件时就乱码了呢?
一看文件果然是输出文件时文件名就已经乱码了,此时想到的就是Java 的系统属性 sun.jnu.encoding 的编码问题,然后在系统中打印出来,如图,系统编码为ANSI_X3.4-1968,
顿时感觉问题有希望解决了,在输出文件之前添加了System.setProperty("sun.jnu.encoding","utf-8");此时再打印出来
虽然已经改成了utf-8但是文件输出的还是乱码,这时候真的很尴尬了,试过很多方法从代码下手试过很多方法依旧不行,此时心里严重怀疑是机器问题,上网查询了一下关于docker编码的问题,发现大家的却经常碰到docker中文编码错误,想去找dockerfile文件看一下,然而怎么找都找不到,问管服务器的人,那人也不吊我,实在没办法硬着头皮让那人换了一个docker镜像(换的这个dokcer镜像是其他项目使用的,文件写出没有问题),然后!然后就好了!此时再去看看java的系统变量编码sun.jnu.encoding就成了utf-8。
果然还是系统编码问题,大家以后还是要相信自己的判断啊!当然前提是要从自身开始找问题,若尝试过各种方法还是不行,就要换一个思路去解决了!不能走进死胡同!
附文件压缩代码:
package test;
import java.io.*;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
public class ZipTest1 {
public static void main(String[] args){
String sysDir = System.getProperty("user.home")+"/测试文件夹";
System.out.println(sysDir);
String txtFileName = new String("测试文本.txt");
String txtContent = new String("测试文本内容");
System.out.println("sun.jnu.encoding"+System.getProperty("sun.jnu.encoding"));
File fileDir = new File(sysDir);
if(!fileDir.exists()){
fileDir.mkdirs();
}
try {
OutputStreamWriter oStreamWriter = new OutputStreamWriter(new FileOutputStream(sysDir+File.separator+txtFileName), "utf-8");
oStreamWriter.append(txtContent);
oStreamWriter.flush();
oStreamWriter.close();
}catch (IOException e){
e.printStackTrace();
}
try {
//压缩文件夹以及文件内容
FileOutputStream fos = new FileOutputStream(new File(sysDir + ".zip"));
ZipOutputStream zos = new ZipOutputStream(fos);
compressbyType(fileDir,zos,"" );
//记得关闭输出流
zos.close();
}catch (Exception e){
e.printStackTrace();
}
}
private static void compressbyType(File src, ZipOutputStream zos, String zipDir) {
if (!src.exists())
return;
System.out.println("压缩路径" + zipDir + src.getName());
//判断文件是否是文件,如果是文件调用compressFile方法,如果是路径,则调用compressDir方法;
if (src.isFile()) {
//src是文件,调用此方法
compressFile(src, zos, zipDir);
} else if (src.isDirectory()) {
//sr是文件夹,调用此方法
compressDir(src, zos, zipDir);
}
}
private static void compressFile(File file, ZipOutputStream zos,String zipDir) {
// String systemEncoding = System.getProperty("file.encoding");
if (!file.exists())
return;
try {
BufferedInputStream bis = new BufferedInputStream(new FileInputStream(file));
// ZipEntry entry = new ZipEntry(baseDir + new String(file.getName().getBytes(systemEncoding),"UTF-8"));
ZipEntry entry = new ZipEntry(zipDir+file.getName());
zos.putNextEntry(entry);
int count;
byte[] buf = new byte[1024];
while ((count = bis.read(buf)) != -1) {
zos.write(buf, 0, count);
}
bis.close();
} catch (Exception e) {
// TODO: handle exception
}
}
private static void compressDir(File dir, ZipOutputStream zos,String zipDir) {
if (!dir.exists())
return;
File[] files = dir.listFiles();
if(files.length == 0){
try {
zos.putNextEntry(new ZipEntry(zipDir + dir.getName()+File.separator));
} catch (IOException e) {
e.printStackTrace();
}
}
for (File file : files) {
compressbyType(file, zos, zipDir + dir.getName() + File.separator);
}
}
}
<!--5f39ae17-8c62-4a45-bc43-b32064c9388a:W3siYmxvY2tUeXBlIjoicGFyYWdyYXBoIiwic3R5bGVzIjp7ImFsaWduIjoibGVmdCIsImluZGVudCI6MCwidGV4dC1pbmRlbnQiOjAsImxpbmUtaGVpZ2h0IjoxLjc1fSwiYmxvY2tJZCI6IjU5OTctMTUzMzAwOTcxNDAyOSIsInJpY2hUZXh0Ijp7ImlzUmljaFRleHQiOnR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4In0seyJjaGFyIjoiXCIifSx7ImNoYXIiOiIpIn0seyJjaGFyIjoiOyJ9XX19LHsiYmxvY2tUeXBlIjoicGFyYWdyYXBoIiwic3R5bGVzIjp7ImFsaWduIjoibGVmdCIsImluZGVudCI6MCwidGV4dC1pbmRlbnQiOjAsImxpbmUtaGVpZ2h0IjoxLjc1fSwiYmxvY2tJZCI6IjcyMjUtMTUzMzAzNTkwNDExMiIsInJpY2hUZXh0Ijp7ImlzUmljaFRleHQiOnRydWUsImtlZXBMaW5lQnJlYWsiOnRydWUsImRhdGEiOlt7ImNoYXIiOiLmraQifSx7ImNoYXIiOiLml7YifSx7ImNoYXIiOiLlho0ifSx7ImNoYXIiOiLmiZMifSx7ImNoYXIiOiLljbAifSx7ImNoYXIiOiLlh7oifSx7ImNoYXIiOiLmnaUifV19fV0=-->
<!--5f39ae17-8c62-4a45-bc43-b32064c9388a:W3siYmxvY2tUeXBlIjoicGFyYWdyYXBoIiwic3R5bGVzIjp7ImFsaWduIjoibGVmdCIsImluZGVudCI6MCwidGV4dC1pbmRlbnQiOjAsImxpbmUtaGVpZ2h0IjoxLjc1fSwiYmxvY2tJZCI6IjQ2NjUtMTUzMzAwODc3NjgwMCIsInJpY2hUZXh0Ijp7ImlzUmljaFRleHQiOnRydWUsImtlZXBMaW5lQnJlYWsiOnRydWUsImRhdGEiOlt7ImNoYXIiOiLml7YifSx7ImNoYXIiOiLpl7QifSx7ImNoYXIiOiLvvJoifSx7ImNoYXIiOiIyIn0seyJjaGFyIjoiMCJ9LHsiY2hhciI6IjEifSx7ImNoYXIiOiI4In0seyJjaGFyIjoiLSJ9LHsiY2hhciI6IjcifSx7ImNoYXIiOiItIn0seyJjaGFyIjoiMyJ9LHsiY2hhciI6IjEifV19fV0=-->
- 大小: 32 KB
- 大小: 160.1 KB
- 大小: 16.2 KB
分享到:
相关推荐
在【压缩包子文件的文件名称列表】中,我们看到只有一个名为"source"的文件或目录,这通常代表源代码文件或者源代码文件夹,包含该项目的所有程序代码。 在这个项目中,我们可以探讨以下几个核心知识点: 1. **...
- **Docker扩展**:了解Docker容器的运行机制和网络设置,有助于在CTF挑战中创建隔离环境。 - **`include`与`include zip://`**:可以包含ZIP压缩文件中的内容,可能会引发文件包含漏洞。 - **无参数RCE**:无需...
10. **项目部署**:项目部署涉及到服务器配置、应用服务器如Tomcat的使用,以及可能的Docker容器化部署,这些都是实际工作环境中不可或缺的技能。 总的来说,这个Java毕业设计和课程设计项目涵盖了从基础编程到高级...
《阿里巴巴Java开发手册(泰山版)》是Java开发者不可或缺的参考资源,由阿里巴巴集团精心编纂...通过深入学习并实践手册中的规范,开发者能够写出更高质量、更易于维护的代码,从而在实际工作中展现出更高的专业素养。
- Docker化部署:了解Docker容器技术,实现应用的快速部署和隔离。 10. **代码审查**: - 代码审查:团队间进行代码审查,提高代码质量,分享知识,减少错误。 这份手册不仅是Java开发者的宝典,也是提升整个...
此外,作为Java开发者和架构师,应持续学习最新的技术和最佳实践,如Java新特性、设计模式、微服务架构、容器化技术(Docker)、持续集成/持续部署(CI/CD)等,以保持与时俱进。同时,良好的团队沟通和项目管理能力...
- Docker容器化,方便在不同Linux环境下部署。 总之,“游戏引擎C++代码Linux”涵盖了C++编程、Linux系统开发以及游戏引擎的诸多核心概念。通过学习和实践,开发者可以创建出高效、跨平台的游戏作品,同时享受到...
- **容器化部署**:使用Docker等容器技术部署,适用于分布式环境。 #### 8. 在UniGUI里使用ADO的设置 在UniGUI中使用ADO(ActiveX Data Objects)通常涉及以下几个步骤: - **添加ADO组件**:在Delphi IDE中添加...
15. **持续集成与部署**:理解Git版本控制,使用Docker容器化技术,以及Jenkins等工具进行持续集成和持续部署。 在阅读这份《Python学习笔记合集》时,配合马士兵老师的视频教程,可以更直观地理解和实践这些概念。...
- **容器化和Docker**:Go在容器化环境中的应用,如Kubernetes中的控制器。 9. **设计原则与最佳实践** - **Go101**:遵循Go语言的设计哲学,学习编写优雅、可维护的Go代码。 - **错误处理**:正确处理错误,...
容器化技术(如Docker)和容器编排系统(如Kubernetes)能帮助实现部署的标准化和可移植性。 最后,**软件测试**是验证软件质量的关键步骤。单元测试、集成测试、系统测试和验收测试是常见的测试类型,它们分别针对...
4. **最佳实践**:了解Go语言的编码规范和最佳实践,这有助于写出更高质量的代码。 5. **实战项目**:参与实际的项目开发,将所学知识应用于解决实际问题,不断积累经验。 总之,Go语言凭借其独特的设计理念和优秀...
2. 容器优化:在Docker或Kubernetes环境中,调整资源配置,避免资源竞争。 3. 系统监控与警报:建立监控体系,实时发现性能问题,并设定阈值触发警报。 综上所述,Linux性能优化涉及多个层面,从监控工具的选择到...
9. **面向对象编程**:理解并实践封装、继承、多态等面向对象编程原则,写出可维护、可扩展的代码。 10. **编码规范**:遵循统一的编码风格,如SUN编码规范,提高代码可读性,方便团队协作。 此外,一个全面的Java...
当代码出现错误时,可以快速定位并给出解决方案。 2. **Ctrl+D**:删除当前行(Delete Line)。快速删除光标所在行。 3. **Ctrl+Shift+Z**:撤销上一个操作(Undo)。与大多数软件中的撤销功能相同。 4. **Ctrl+Z**...
同时,配合Docker等容器技术,可以轻松实现持续集成和持续部署(CI/CD)。 尽管“wifi_car_go”项目的具体实现细节未给出,但以上这些知识点都是在开发此类项目时可能会涉及的Go语言核心技术。通过这些技术,开发者...
1. 自动化部署:使用Shell脚本来自动化构建、测试和部署过程,例如使用git pull更新代码,使用docker-compose启动容器等。 2. 监控与报警:编写监控脚本,定期检查系统状态,异常时发送邮件或短信报警。 3. 数据备份...
- Go常用于微服务、云基础设施、网络编程、大数据处理和容器编排系统(如Docker)等。 以上是对Go语言及其相关知识的概述,"CurgoGolang"项目可能深入探讨了这些话题中的某个或多个方面,例如提供了示例代码、最佳...