项目部署到线上byte[]转换中文乱码,本地是好的

项目部署到线上byte[]转换中文乱码,本地是好的

byte[]转换成中文乱码,在idea上面调试没有乱码,部署到线上就乱码,原因是idea启动项目是utf-8,

然后线上是windows环境不知道啥

bash 复制代码
                vo.setJsonObject(JSONUtil.parseObj(Convert.toStr(StrUtil.str(processDesignHis.getContent(), Charset.defaultCharset()),"{")));

我开始以为这个Charset.defaultCharset() 里面就是utf-8,然后我把这个打印出来发现在,线上是的gbk

在这里插入图片描述

然后我果断就把这个改成了 utf-8 ,或者在启动的时候 把启动脚本加上编码格式

在这里插入图片描述

相关推荐
消失的旧时光-194311 分钟前
Spring Boot 核心机制之 @Conditional:从原理到实战(一次讲透)
java·spring boot·后端
huabiangaozhi26 分钟前
跟据spring boot版本,查看对应的tomcat,并查看可支持的tomcat的版本范围
spring boot·后端·tomcat
AI服务老曹41 分钟前
打破视频孤岛:基于 ZLMediaKit 的 GB28181 与 RTSP 统一接入网关架构设计
人工智能·spring boot·音视频
xyyaihxl1 小时前
将 vue3 项目打包后部署在 springboot 项目运行
java·spring boot·后端
chenxu98b1 小时前
前端的dist包放到后端springboot项目下一起打包
前端·spring boot·后端
sunwenjian8861 小时前
跨域问题解释及前后端解决方案(SpringBoot)
spring boot·后端·okhttp
0xDevNull1 小时前
Spring Boot 3.x 整合 Nacos 全栈实战教程
java·spring boot·nacos
java干货1 小时前
在微服务里造一个微缩版 Kafka:Spring Boot 整合 Redis Stream 全指南
spring boot·微服务·kafka
biubiubiu07061 小时前
Maven 父子工程 SpringBoot 多模块
java·spring boot·maven
qqty12171 小时前
springcloud springboot nacos版本对应
spring boot·spring·spring cloud