note 101431 added to function.iptcembed
| From: | ChristophTavan at osu1 dot php dot net | Date: | Thu, 16 Dec 2010 11:30:13 +0000 |
| Subject: | note 101431 added to function.iptcembed | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-174978@lists.php.net to get a copy of this message | ||
For everybody having issues with unicode (UTF-8) text in IPTC fields, set the "Coded Character
Set"-field in the envelop (1:90, see http://www.iptc.org/std/IIM/4.1/specification/IIMV4.1.pdf).
This can be accomplished by starting the $data-block with the following lines:
<?php
// These two lines ensure that UTF8-Encoding will work (set the 1:90 field in the envelop)
// @see http://cpanforum.com/threads/2114 for a hint
$utf8seq = chr(0x1b) . chr(0x25) . chr(0x47);
$length = strlen($utf8seq);
$data = chr(0x1C) . chr(1) . chr('090') . chr($length >> 8) . chr($length &
0xFF) . $utf8seq;
?>
After that you can continue like in the example:
<?php
foreach($iptc as $tag => $string)
{
$tag = substr($tag, 2);
$data .= iptc_make_tag(2, $tag, $string);
}
?>
----
Server IP: 69.147.83.197
Probable Submitter: 77.20.85.140
----
Manual Page -- http://www.php.net/manual/en/function.iptcembed.php
Edit -- https://master.php.net/note/edit/101431
Del: integrated -- https://master.php.net/note/delete/101431/integrated
Del: useless -- https://master.php.net/note/delete/101431/useless
Del: bad code -- https://master.php.net/note/delete/101431/bad+code
Del: spam -- https://master.php.net/note/delete/101431/spam
Del: non-english -- https://master.php.net/note/delete/101431/non-english
Del: in docs -- https://master.php.net/note/delete/101431/in+docs
Del: other reasons-- https://master.php.net/note/delete/101431
Reject -- https://master.php.net/note/reject/101431
Search -- https://master.php.net/manage/user-notes.php