jsp中想要輸出的中文被顯示成問號(hào)?在eclipse-windows- preferences中搜索jsp,encoding選項(xiàng)中選擇 chinese,此問題便可解決
問題: jsp中想要輸出的中文被顯示成“?”
解決方法 : 在eclipse-windows- preferences中 搜索jsp , encoding選項(xiàng)中選擇 chinese 。 這樣新建的jsp文件將支持中文顯示。
對(duì)已經(jīng)存在的jsp文件做如下修改: 將各種編碼方式都改成gb18030,如下:
代碼如下:
<%@ page language=java contenttype=text/html; charset=gb18030
pageencoding=gb18030%>
<!doctype html public -//w3c//dtd html 4.01 transitional//en >
<html>
<head>
<meta http-equiv=content-type content=text/html; charset=gb18030>
<title>hello</title>
</head>
<body>
你好
</body>
</html>
則“你好”可正確顯示
更多信息請(qǐng)查看IT技術(shù)專欄