My problem is, I can't insert correctly accented characters (á é í ó ú ñ) in my DB.
This is my output console:
As you can see the original text of the column grupo
is Cómputo integrál
.
The same happens in my output web browser:
This is my servlet code:
//Save the input form and search immediately
tx.begin();
Salon get = (Salon) session.get(salon.getClass(), 1);
tx.commit();
request.setCharacterEncoding("utf8");//Línea para que se ingresen de forma correcta los caracteres.
response.setContentType("text/html;charset=ISO-8859-1");
try (PrintWriter out = response.getWriter())
{
out.println("Salida de texto: " + get.getGrupo());
}
This is my meta html code:
<meta charset="UTF-8">
And my DB is configured with the collation utf8 - utf8_spanish_ci
What I can do to save, insert, show and update correctly?