当前位置:网站首页>Completely solve the problem of Chinese garbled code in Web Engineering at one time
Completely solve the problem of Chinese garbled code in Web Engineering at one time
2022-06-27 13:36:00 【Spring-_- Bear】
List of articles
One 、IDEA The console is garbled
IDEA Set the file code as UTF-8

modify IDEA The installation directory bin Under the
idea.exe.vmoptionsandidea64.exe.vmoptions, Add at the end of the line-Dfile.encoding=UTF-8
IDEA Set the console print to use UTF-8 code

Two 、 Request data garbled
IDEA Revision in China Tomcat Use
-Dfile.encoding=UTF-8
modify Tomcat The installation directory conf Under the
server.xml, stay<Connector/>Add... To the tagURIEndcong="UTF-8"solve GET Ask for random code
modify Tomcat The installation directory bin Next
catalina.bat, Add... In the following location-Dfile.encoding=UTF-8(-Dfile There can only be one space before )
HTML Page in JavaScript Use when file UTF-8 code
<script type="text/javascript" charset="UTF-8" th:src="@{/static/js/login.js}"></script>Clear browser cache , restart Tomcat
3、 ... and 、 Deploy Linux The statement
pom.xmlSet in Maven Use when packaging items UTF-8 code , Avoid generating bytecode files that are not UTF-8 After the code is deployed to the remote server, it is garbled again<properties> <maven.compiler.source>8</maven.compiler.source> <maven.compiler.target>8</maven.compiler.target> <spring.version>5.3.1</spring.version> <!-- Maven The packaging code is specified as UTF-8, Avoid random code after the project is deployed to the remote server --> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <!-- Maven Skip testing when packaging --> <maven.test.skip>true</maven.test.skip> </properties>
边栏推荐
- [acwing] explanation of the 57th weekly competition
- 实现WordPress上传图片自动重命名的方法
- Different habits
- Istio微服务治理网格流量管理核心资源控制器详解
- Does Xinhua San still have to rely on ICT to realize its 100 billion enterprise dream?
- [dynamic programming] - Knapsack Problem
- Privacy computing fat offline prediction
- scrapy
- 与生活握手言和
- 【周赛复盘】LeetCode第81场双周赛
猜你喜欢

ensp云朵配置

爱可可AI前沿推介(6.27)

Using FRP tool to realize intranet penetration

TCP 流控问题两则

局域网即时通讯软件应该怎么选择

Crane: a new way of dealing with dictionary items and associated data

Yuweng information, a well-known information security manufacturer, joined the dragon lizard community to build an open source ecosystem

Size end byte order

每日刷题记录 (六)

Postman如何设置成中文?(汉化)
随机推荐
Prometheus 2.26.0 新特性
Clear self orientation
命令行编辑器 sed 基础用法总结
一次性彻底解决 Web 工程中文乱码问题
与生活握手言和
Journal quotidien des questions (6)
Two TCP flow control problems
局域网即时通讯软件应该怎么选择
zabbix支持钉钉报警
Shake hands with life and make peace
hue新建账号报错解决方案
MySQL locking mechanism and four isolation levels
Differences in perspectives of thinking
【问题解决】Tensorflow中run究竟运行了哪些节点?
CMOS级电路分析
快讯:华为启动鸿蒙开发者大赛;腾讯会议发布“万室如意”计划
After the deployment is created, the pod problem handling cannot be created
How to choose LAN instant messaging software
Different habits
Principle of printf indefinite length parameter