idea println及server控制台输出时中文乱码

165 阅读1分钟

一、问题描述

使用println输出中文字符时,发现server的日志输出中午以及输出语句中的中文字符都乱码了

image.png

二、问题解决

2.1 控制台日志输出乱码解决

找到本机的tomcat安装目录/conf/logging.properties

设置:java.util.logging.ConsoleHandler.encoding = GBK

image.png

2.2 println输出时乱码问题解决

image.png

三、效果展示

image.png