-2
I have a question regarding accentuation, specifically the return of Ç
. My bank has the collation latin1_swedish_ci
, I’m using the HTML tags:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html lang="pt-BR">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
And in the bank is recorded correctly Ç
and accents as below:
But when it comes to displaying the data, it appears that way:
PHP displays this way (in the 3rd line I did a test that did not work):
foreach ($saidas as $saida) { ?>
<tr>
<td><?php echo $saida['reserva'] ?></td>
<td><?php echo $saida['motorista'] ?></td>
<td><?php header("Content-Type: text/html; charset=ISO-8859-1", true); echo $saida['setor'] ?></td>
<td><?php echo $saida['email'] ?></td>
<td><?php echo $saida['veiculo'] ?></td>
<td><?php echo $saida['destino'] ?></td>
<td><?php echo $saida['data'] ?></td>
<td><?php echo $saida['saida'] ?></td>
<td><?php echo $saida['retorno'] ?></td>
<td><?php echo $saida['retorno_real'] ?></td>
</tr>
<?
Any suggestions?
test with the collation to
utf8_general_ci
– RFL
Rafael, I changed the collation of the bank and the tables but it didn’t work either.
– Diego
@Are you using any framework or are you using pure PHP? and remember, when you make the changes in the collation the data that is already in the database has not changed, only the new data will be validated with the new rule.
– RFL
Because it’s Diego.. You’ll find dozens of different tips and you’ll try them all. Most unsuccessfully and without knowing what you’re doing. And still running the risk of corrupting the data. The right thing to do is to start with diagnostics and try to understand how to analyze the current environment situation. Never apply a remedy without making a proper diagnosis. Don’t expect a magic solution because you don’t have one. But if you want, you can keep trying your luck. Soon someone will point out the
utf8_decode()
at random. That’s where the magic starts to happen. rsrs– Daniel Omine
This question was the subject of this debate: http://meta.pt.stackoverflow.com/q/4640/132
– Victor Stafusa