SpringBoot内置Tomcat控制台打印中文乱码解决

在使用SpringBoot内置Tomcat时,控制台打印中文乱码如图

image

看了网上很多帖子说POM添加依赖设置中文

		<plugin>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-maven-plugin</artifactId>
			<configuration>
				<fork>true</fork>
				<!-- spring-boot:run 中文乱码解决 -->
				<jvmArguments>-Dfile.encoding=UTF-8</jvmArguments>
			</configuration>
		</plugin>

我试了没有成功,后来在Idea->run

image

添加如下代码

-Dfile.encoding=UTF-8
image

应用重启即可~

image

posted @ 2020-08-20 10:20  Power_Gives  阅读(768)  评论(0)    收藏  举报