When I call the below code with $text with Spanish I got correct text with image but When I call the same code with $text with Catalan I don't get correct text in the image. I understand that Spanish Special chars á and é are working but Catalan characters à and è are not working.
Can you please help me to correct this problem.
<?php
//$text = "Sándalo Ayurvédicos"; // Text in Spanish
$text = "Sàndal Ayurvèdics"; // Text in Catalan
//$text = utf8_encode($text);
//$text = utf8_decode($text);
$img = "sample";
$im = imagecreatetruecolor(25, 350);
$black = imagecolorallocate($im, 0, 0, 0);
imagecolortransparent($im, $black);
$textcolor = imagecolorallocate($im, 73, 100, 23);
imagestringup($im, 3, 10, 340, $text,$textcolor);
imagepng($im, $img.'.png');
imagedestroy($im);
$imagename = $img.'.png';
print '<img src="'.$imagename.'"></img>';
?>