JSP Chinese display question mark problem solution


Question: the Chinese that you want to output in JSP is displayed as “?”

Solution: search JSP in eclipse windows preferences, and select Chinese in the encoding option. In this way, the new JSP file will support Chinese display.

Modify the existing JSP file as follows: change all encoding methods to GB18030, as follows:

Copy codeThe code is as follows:
<%@ page language=”java” contentType=”text/html; charset=GB18030″
<!DOCTYPE html PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN” “http://www.w3.org/TR/html4/loose.dtd”>
<meta http-equiv=”Content-Type” content=”text/html; charset=GB18030″>

Then “hello” can be displayed correctly