Hello,
When I put unicode XMP keyword (embedded in photo) in other languages, eg. Thai language, it will not show under Info->Image Tags, and will not be searchable. To my understanding TWG uses function utf8_encode and that ignores all symbols and characters from other languages.
I went ahead and did a temporary hack that fixes the issue. Hopefully this can be refined by TWG and to allow unicode tags into next release.
Best Regards,
Pumin
inc/readxml.inc.phpline# 1328 change
Code:
//$retArray["image"] = ($iptc_encoding == 'utf-8') ? $retArray["image"] : utf8_encode($retArray["image"]);
$retArray["image"] = ($iptc_encoding == 'utf-8') ? $retArray["image"] : myUrlEncode($retArray["image"]);
line# 1457
Code:
//$xml_string = "<BILD><NAME>" . urlencode($image) . "</NAME><WERT>" . UrlEncode($tags_image) . "</WERT></BILD>\n";
$xml_string = "<BILD><NAME>" . urlencode($image) . "</NAME><WERT>" . $tags_image . "</WERT></BILD>\n";
Code:
function myUrlEncode($string) {
// credit to davis.peixoto
$entities = array('%21', '%2A', '%27', '%28', '%29', '%3B', '%3A', '%40', '%26', '%3D', '%2B', '%24', '%2C', '%2F', '%3F', '%25', '%23', '%5B', '%5D');
$replacements = array('!', '*', "'", "(", ")", ";", ":", "@", "&", "=", "+", "$", ",", "/", "?", "%", "#", "[", "]");
return str_replace($entities, $replacements, $string);
}