From 5aafffb22b39c7347e261e2a7f56ba541e5f079e Mon Sep 17 00:00:00 2001 From: rvelices Date: Tue, 9 Oct 2007 22:43:09 +0000 Subject: - RSS feed is PWG charset - iptc are now converted from iso-8859-1 or utf-8 (automatic detection) to pwg charset - remove function get_language_filepath - load_language also checks for the default language git-svn-id: http://piwigo.org/svn/trunk@2132 68402e56-0260-453c-a942-63ccdbb3a9ee --- include/functions_metadata.inc.php | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include/functions_metadata.inc.php') diff --git a/include/functions_metadata.inc.php b/include/functions_metadata.inc.php index aa162e14b..89a2eeb8e 100644 --- a/include/functions_metadata.inc.php +++ b/include/functions_metadata.inc.php @@ -89,6 +89,16 @@ function clean_iptc_value($value) // remove binary nulls $value = str_replace(chr(0x00), ' ', $value); + if ( preg_match('/[\x80-\xff]/', $value) ) + { + // apparently mac uses some MacRoman crap encoding. I don't know + // how to detect it so a plugin should do the trick. + $value = trigger_event('clean_iptc_value', $value); + $is_utf8 = seems_utf8($value); + $value = convert_charset( $value, + $is_utf8 ? 'utf-8' : 'iso-8859-1', + get_pwg_charset() ); + } return $value; } -- cgit v1.2.3