If you use the ant script to create war files, if the project contains files with Chinese file names, the names of these files in the war files will become garbled, if you use myeclipse to deploy Tomcat and compress it into war, the same problem also exists.
After checking on the Internet for a long time, I finally found the solution. I added the encoding = "GBK" parameter to the war tag of the ant script and ran the script again. It was really easy to use and there was no garbled code.
Sample script:
<Project name = "XXXX" default = "war" basedir = ".">
<Description> XXXX </description>
<Property name = "project. Name" value = "XXXX"/>
<Property name = "Web. Root" value = "webroot"/>
<! -- Create a web archive that can be deployed to an app server -->
<Target name = "war">
<WarEncoding = "GBK"Destfile = "$ {project. name}. War"
Webxml = "$ {web. Root}/WEB-INF/Web. xml"
Basedir = "$ {web. Root}"/>
</Target>
</Project>