Home > Software design >  Is there something I should put to make japanese characters visible?
Is there something I should put to make japanese characters visible?

Time:11-23

I was trying to make a page in different languages, but japanese characters are shown as question marks. The Portuguese and English versions of the page are working so i wanted to know if there is an specific thing i should do.

<%@ 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> 

enter image description here enter image description here

CodePudding user response:

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"

I think you should make charset encoding as charset="UTF-8"

<%@ page language="java" contentType="text/html; charset=UTF-8"

CodePudding user response:

First thing I would check is if any Japanese fonts are available in the local machine.

  • Related