Garbled characters occur when jst <c: import> is imported to html in jsp. The cause is org. apache. taglibs. standard. tag. common. core. ImportSupport.
If the charEncoding value of is null, charEncoding is the default value, that is, the ISO-8859-1.
Fortunately, charEncoding can be directly set through <c: import>, so you only need to set it. Many people say that you can set contentType through meta in html, however, I have tried this before. I can set this only by looking at the jstl source code, because cimport is usually used to import jsp, And the settings in jsp are feasible, but not static pages. The main code of ImportSupport is as follows:
Copy codeThe Code is as follows:
Reader r = null;
String charSet;
String charSet;
If (this. charEncoding! = Null )&&(! This. charEncoding. equals (""))){
CharSet = this. charEncoding;
}
Else {
String contentType = uc. getContentType ();
If (contentType! = Null ){
String charSet = Util. getContentTypeAttribute (contentType, "charset ");
If (charSet = null) charSet = "ISO-8859-1 ";
}
Else {
CharSet = "ISO-8859-1 ";
}
}