What should I do if java utf-8 is garbled?
1. Write the following code in the first part of html:
Recommended tutorial: "java learning"
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
The example is as follows:
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%> <script> </script>login.jsp
If unsuccessful,
2. Modify the properties of the garbled project file. The garbled code is as shown in the figure.
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>login.jsp
Right-click the login.jsp under the project and select the bottom Properties
Select Other and change to utf-8
Click Apply, OK
If unsuccessful,
3. Right-click the project and perform the above operations
If it still fails,
4. Right-click the garbled file under the project,
Click on the pattern in the red box to find the original file (you can also find the original file on my computer)
Open with Edit with Notepad
Click encoding, select "Use UTF-8 encoding", and then save
In addition to the above four types, you can also select Properties under Project to modify properties as shown below
##The above is the detailed content of What to do if java utf-8 garbled characters. For more information, please follow other related articles on the PHP Chinese website!