summaryrefslogtreecommitdiff
path: root/modules/tag/helpers
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-05-05 03:30:49 +0000
committerBharat Mediratta <bharat@menalto.com>2009-05-05 03:30:49 +0000
commit13f8a0dd7baf07ebddc72c1764b5ab13f3c9f42c (patch)
treeb0d5a2f006c1dd9a528c4eb7eca2e428b40566ac /modules/tag/helpers
parent2434feabeb9244eabe61d906eafce7adb518319e (diff)
Detect input encodings from EXIF/IPTC data and convert to utf-8 as
appropriate. This allows us to switch the exif value column back to varchar and improves the way that we deal with non-utf8 data in our embedded EXIF/IPTC data.
Diffstat (limited to 'modules/tag/helpers')
-rw-r--r--modules/tag/helpers/tag_event.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/tag/helpers/tag_event.php b/modules/tag/helpers/tag_event.php
index a301c441..a4a6ec26 100644
--- a/modules/tag/helpers/tag_event.php
+++ b/modules/tag/helpers/tag_event.php
@@ -34,7 +34,10 @@ class tag_event_Core {
if (!empty($iptc["2#025"])) {
foreach($iptc["2#025"] as $tag) {
$tag = str_replace("\0", "", $tag);
- $tags[$tag]= 1;
+ if (mb_detect_encoding($tag) != "UTF-8") {
+ $tag = utf8_encode($tag);
+ }
+ $tags[$tag] = 1;
}
}
}