0
I have a classic encoding problem, I’ve done several tests, but nothing solved. The problem only occurs with data brought from the database in Sql Server, with the text fixed on the screen ta working perfectly.
tried:
add to jsp: <%@page contenttype="text/html"pageEncoding="UTF-8"%>
use the collate "Sql_latin1_general_cp1_ci_as" in the select of sqlserver
add "Characterset=UTF-8" to the connection string jdbc
and others, but could not solve the problem, follows below a table record to serve as an example:
"Failure to register WS"
Someone knows me what I can do to fix this?
It would be interesting to add the source of the problem to your code in the question.
– user28595
What do you mean, the source of the problem? the data is recorded in the system in this way "There is a failure in the WS register" to be displayed normally, with this "Estãgá" has to be displayed as "is", that’s what you meant to say?
– user3061516
@user3061516 From what I understood from the record of the table you provided, the data is recorded wrong in the database. Is that right? If it is, all you did will not fix the problem, after all it would be in the input and not in the output.
– utluiz
Dude, this is a "charset" problem in php if I do a " header('Content-type: text/html; charset=UTF-8'); "resolve, I want to know how to solve this in java.
– user3061516
The problem is that some versions of SQL Server do not support UTF-8 natively, as can be seen on this page: https://support.microsoft.com/pt-br/help/232580/description-of-storing-utf-8-data-in-sql-server But there are ways to overcome this inconvenience, even losing some functionality, as explained in steps 4 and 5.
– Antonio Alexandre