jsp Chinese shows question mark problem solution

  • 2020-06-23 01:41:59
  • OfStack

Question: In jsp, the Chinese you want to output is shown as "?"

Solution: Search jsp in ES3en-ES4en-ES5en and select Chinese from the Encoding option. The new jsp file will support Chinese language display.

Modify the existing jsp file as follows: change all encoding methods to GB18030, as follows:
 
<%@ page language="java" contentType="text/html; charset=GB18030" 
pageEncoding="GB18030"%> 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 
<html> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=GB18030"> 
<title>Hello</title> 
</head> 
<body> 
 hello  
</body> 
</html> 

Then "Hello" can be displayed correctly

Related articles: