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.
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