1
I would like to know how to proceed in a situation. Where by default I create all the files of the site with standard coding in UTF-8.
But when I tried to create an image with GD, the image appears broken... Then when I switch to Western Europero (iso-8859-1). Works correctly.
How do I run this file created in UTF-8, so I can maintain the standard of creating the files?
<?php
header("Content-type: image/png");
$im = @imagecreate(200, 800)
or die("Cannot Initialize new GD image stream");
$background_color = imagecolorallocate($im, 0, 0, 0);
$text_color = imagecolorallocate($im, 233, 14, 91);
imagestring($im, 10, 5, 5, "A Simple é você Text String", $text_color);
imagepng($im);
imagedestroy($im);
?>
I suspect it is due to GOOD. When using utf-8 make sure to remove the GOOD character (bit order mark)... To do this, using the text editor itself, set the charset to "UTF-8 Without BOM". This depends on the editor you use.. Some define it as "UTF-8 ANSI".
– Daniel Omine
Interesting, because Dreanweaver when I put without BOM, he does nothing, still generating error... Then when I open Notepad++ it shows the UTF-8 normal, I believe it is a problem in Dreanweaver, because when I put no Good in Notepad++ works correctly...
– abcd
@abcd If you can add as a response the problem resolution, then mark as accepted.
– stderr
@Danielomine puts as answer your comment p/ we close this question
– SneepS NinjA
is done, Maison.
– Daniel Omine