Perl SetNewValue IPTC incorrect if not utf8::upgrade'd

Started by umann, November 25, 2017, 09:40:29 AM

Previous topic - Next topic

umann

When setting an IPTC field with a Perl variable that is not upgraded to utf8 (but not ASCII either), it is written to jpeg incorrectly.

Attached iptc_utf8_upgrade.pl prints (for me):


system: MSWin32
perl: v5.16.3
exiftool: 10.55

not ok 1 - not_utf8_upgraded.jpg [IPTC] City
#   Failed test 'not_utf8_upgraded.jpg [IPTC] City'
#   at iptc_utf8_upgrade.pl line 46.
#          got: 'Qu'
#     expected: 'Québec'
ok 2 - utf8_upgraded.jpg [IPTC] City
# Looks like you failed 1 test of 2.

Phil Harvey

You need to specify the character sets.  See FAQ 10 for help with this.  ExifTool treats all input data as byte streams.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).