I'm generating an image, which is basically a simple text. Only the text gets the accents "bugados", all incorrect, even I defining the coding for utf-8. Here is the code:
<?php
header('Content-Type: image/png; charset=utf-8');
draw("Olá, como vai você?");
function draw($text){
$imagem = imagecreate(700, 30);
$fundo = imagecolorallocate($imagem, 241, 243, 240);
$color = imagecolorallocate($imagem, 200, 30, 30);
imagestring($imagem, 5, 0, 0, $text, $color);
imagepng($imagem);
imagedestroy($imagem);
}
?>
This is just a "short version" of the code I want to do. Because it involves more than a single sentence ... The code is just for example of my problem.
The draw()
it is executed only once. What varies is just the text ...