question: Recently, garbled data appeared when deploying the project. After checking, the project used the UTF-8 encoding format, and the data was also used. However, when it was transmitted to the other party through the calling interface, it was garbled. Since it is deployed in a Windows environment, the default encoding of Windows is GBK, which leads to the problem of inconsistent encoding during JVM runtime, and it is also easy to modify. Solution: If you use UTF-8 encoding in Linux environment, you do not need to modify it, because Linux defaults to UTF-8 The war package is deployed in Tomcat Modify jvm encoding Linux Environment Configuration in catalina.sh Since the default encoding format in Windows environment is GBK, you need to change the encoding format when Tomcat is running. Windows Environment Configuration in catalina.bat If it is a jar package deployment, you only need to add the jvm parameter to the startup command. JAR package deployment Add jvm parameters to the startup command Summarize The above is the editor's introduction to modifying the JVM encoding problem when running Tomcat. I hope it will be helpful to everyone! You may also be interested in:
|
<<: Implementing calculator functions with WeChat applet
>>: Example analysis of the page splitting principle of MySQL clustered index
Table of contents Scenario Code Implementation Su...
Table of contents 1. Install html2Canvas 2. Intro...
CSS 3 animation example - dynamic effect of Tab b...
This article shares the specific code for drawing...
Continuing from the previous article, we will cre...
This article shares the specific code for JavaScr...
background When performing a SQL query, I tried t...
Currently I have made a project, the interface is ...
1. Prepare the Docker environment 2. Search for f...
Table of contents Preface think Library directory...
1. After installing the Windows version of Docker...
To draw a table in HTML, use the table tag tr me...
Refer to the official document http://dev.mysql.c...
Table of contents 1. What is block scope? 2. Why ...
Ideas It's actually very simple Write a shell...