I'm experiencing some problems with charset encoding in my web-based application. Despite I've properly configured page encoding, special chars continue being shown truncated.
I'm using JQuery Easy UI plugins to do a great part of the job, but the problem also occours in simple jQuery/Javascript codes, as alert boxes, for example.
JSP Page Header:
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8"%> <!-- "ISO-8859-1" -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
(...)
jQuery code:
$.fn.altStatusTarefa =
function (idStat, idTar){
var motivo =prompt("Informe o motivo da alteração:",
"(Descrição suscinta)");
if (motivo!=null && motivo!="")
{
var result = $.post("TarefaUpdateStatus", {
idTarefa : idTar,
idStatus : idStat,
motivoAlt : motivo
}
);
result.done(function( data ) {
$.messager.show({
title:'Sucesso',
msg:'A alteração foi processada. ' +
'Tecle F5 para atualizar o formulário.',
showType:'show'
});
});
result.fail(function(jqXHR, textStatus) {
$.messager.alert('Erro',
'Houve um problema na atualização: ' +
textStatus,'error');
});
result.always({
});
}
else{
alert("Alteração cancelada.");
}
};
All these special characters (ã, ç, é, etc.) are truncated during runtime.
Any idea on what could be happening or what's the solution? Thanks!