I have a Finnish gallery, and I have written title and keywords straight in jpg files. (IPTC metadata). The problem has been special characters (umlauts) we use in Finland. Photoshop with Mac writes IPTC data with MacRoman characters, so they have to converted to UTF-8 before writing to database.
I found a script that changed MacRoman extended characters to UTF-8 characters.
It worked OK with older versions. Now when I tried to upgrade 1.4.12 from 1.3.x, I found the script do not work properly.
If the umlaut character is in the beginning or in the end of the word, it will disappear.
I am not any coding expert, so if someone could find a solution, it would be nice. I also think the solution could be useful to some other users too
I have changed file /include/picmgmt.inc.php from line 43.
Here is an original version:
if ($CONFIG['read_iptc_data']) {
$iptc = get_IPTC($image);
if (is_array($iptc) && !$title && !$caption && !$keywords) { //if any of those 3 are filled out we don't want to override them, they may be blank on purpose.
$title = (isset($iptc['Title'])) ? $iptc['Title'] : $title;
$caption = (isset($iptc['Caption'])) ? $iptc['Caption'] : $caption;
$keywords = (isset($iptc['Keywords'])) ? implode(' ',$iptc['Keywords']) : $keywords;
}
And here is the modified version:
if ($CONFIG['read_iptc_data']) {
$iptc = get_IPTC($image);
if (is_array($iptc) && !$title && !$caption && !$keywords) { //if any of those 3 are filled out we don't want to override them, they may be blank on purpose.
$title = (isset($iptc['Title'])) ? $iptc['Title'] : $title;
$title=ereg_replace(128, "Ä",$title);
$title=ereg_replace(138, "ä",$title);
$title=ereg_replace(133, "Ö",$title);
$title=ereg_replace(154, "ö",$title);
$title=ereg_replace(134, "Ü",$title);
$title=ereg_replace(159, "ü",$title);
$title=ereg_replace(205, "Õ",$title);
$title=ereg_replace(155, "õ",$title);
$title=ereg_replace(129, "Å",$title);
$title=ereg_replace(140, "å",$title);
$title=ereg_replace(175, "Ø",$title);
$title=ereg_replace(191, "ø",$title);
$title=ereg_replace(190, "æ",$title);
$title=ereg_replace(174, "Æ",$title);
$title=ereg_replace(169, "©",$title);
$caption = (isset($iptc['Caption'])) ? $iptc['Caption'] : $caption;
$caption=ereg_replace(128, "Ä",$caption);
$caption=ereg_replace(138, "ä",$caption);
$caption=ereg_replace(133, "Ö",$caption);
$caption=ereg_replace(154, "ö",$caption);
$caption=ereg_replace(134, "Ü",$caption);
$caption=ereg_replace(159, "ü",$caption);
$caption=ereg_replace(205, "Õ",$caption);
$caption=ereg_replace(155, "õ",$caption);
$caption=ereg_replace(129, "Å",$caption);
$caption=ereg_replace(140, "å",$caption);
$caption=ereg_replace(175, "Ø",$caption);
$caption=ereg_replace(191, "ø",$caption);
$caption=ereg_replace(190, "æ",$caption);
$caption=ereg_replace(174, "Æ",$caption);
$caption=ereg_replace(169, "©",$caption);
$keywords = (isset($iptc['Keywords'])) ? implode(' ',$iptc['Keywords']) : $keywords;
$keywords=ereg_replace(128, "Ä",$keywords);
$keywords=ereg_replace(138, "ä",$keywords);
$keywords=ereg_replace(133, "Ö",$keywords);
$keywords=ereg_replace(154, "ö",$keywords);
$keywords=ereg_replace(134, "Ü",$keywords);
$keywords=ereg_replace(159, "ü",$keywords);
$keywords=ereg_replace(205, "Õ",$keywords);
$keywords=ereg_replace(155, "õ",$keywords);
$keywords=ereg_replace(129, "Å",$keywords);
$keywords=ereg_replace(140, "å",$keywords);
$keywords=ereg_replace(175, "Ø",$keywords);
$keywords=ereg_replace(191, "ø",$keywords);
$keywords=ereg_replace(190, "æ",$keywords);
$keywords=ereg_replace(174, "Æ",$keywords);
$keywords=ereg_replace(169, "©",$keywords);
}