我試圖用不同的語言制作一個頁面,但日語字符顯示為問號。該頁面的葡萄牙語和英語版本正在運行,所以我想知道是否有我應該做的特定事情。
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<c:if test="${not empty param.local }">
<fmt:setLocale value="${param.local}" scope = "session"/>
</c:if>
<fmt:setBundle basename="resources.mensagens" />
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Teste</title>
</head>
<body>
<a href = "?local=pt_BR"><fmt:message key="portugues" /></a>
<a href = "?local=en_US"><fmt:message key="ingles" /></a>
<a href = "?local=ja"><fmt:message key="japones" /></a>
<fmt:message key = "titulo" />
<fmt:message key = "bemvindo" />
<form action="">
<fmt:message key = "nome" /> : <input type="text" name = "nome">
<input type="submit" value= "<fmt:message key="enviar" />">
</form>
</body>
</html>
在此 輸入圖片說明 在此輸入圖片說明
uj5u.com熱心網友回復:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
我認為你應該將字符集編碼為 charset="UTF-8"
<%@ page language="java" contentType="text/html; charset=UTF-8"
uj5u.com熱心網友回復:
我要檢查的第一件事是本地機器上是否有可用的日文字體。
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/370873.html
下一篇:反應狀態更新并顯示新值
