When reading the IPTC data from an image, UTF-8 accented characters are not displaying properly when reading them via PHP.
For example: é, ø and ü
With a header content-type set as UTF8, instead of the character, I get the question mark in a black diamond. � If no content-type is set, then I get a dash character: —
The following is the code being used to read the IPTC block:
$file = '/path/to/image.jpg';
getimagesize($file, $info);
$iptc = iptcparse($info['APP13']);
I have also tried uploading the exact same image to a WordPress installation on the same server, and it properly strips the accented character and replaces it with it's basic latin equivalent. I don't mind if this is the end result, I would just like to read the characters properly.
Any ideas on how to get the complete and correct data from the image?