Talking about the garbled characters introduced by jsp files and HTML files,
 
1. problems encountered when using the include command to introduce HTML files in jsp:
 
Jsp and html can be correctly displayed. When jsp introduces html, garbled characters occur when accessing the HTML page of jsp. The original jsp output is not garbled. solution:
 
Add <% @ page language = "java" import = "java. util. *" pageEncoding = "UTF-8" %> to the first line of HTML.
 
The jsp encoding format is: <% @ page language = "java" import = "java. util. * "contentType =" text/html; charset = UTF-8 "pageEncoding =" UTF-8 "%>
 
2. garbled characters occur when converting html pages into jsp pages:
 
If the original html code is UTF-8, add <% @ page pageEncoding = "UTF-8" %> to the top of the html
 
Then, modify the suffix to. jsp, that is, first modify the encoding format before converting to a jsp file.
 
The above discussion about the Garbled text introduced by jsp files and HTML is all the content shared by Alibaba Cloud xiaobian. I hope you can give us a reference and support for the customer's house.