ExifTool Forum

ExifTool => Bug Reports / Feature Requests => Topic started by: umann on November 25, 2017, 09:40:29 AM

Title: Perl SetNewValue IPTC incorrect if not utf8::upgrade'd
Post by: umann on November 25, 2017, 09:40:29 AM
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.
Title: Re: Perl SetNewValue IPTC incorrect if not utf8::upgrade'd
Post by: Phil Harvey on November 25, 2017, 05:24:37 PM
You need to specify the character sets.  See FAQ 10 (https://exiftool.org/faq.html#Q10) for help with this.  ExifTool treats all input data as byte streams.

- Phil