ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: van Dusen on May 31, 2011, 11:24:55 AM

Title: How to write Latin1-encoded IPTC-values?
Post by: van Dusen on May 31, 2011, 11:24:55 AM
Concerns ExifTool.exe v8.57 on WinXP Pro SP3

As far as my experience goes, IPTC tags will be written always UTF8-encoded. Is there still any way to store values of IPTC tags Latin1 encoded?

According the ExifTool documentation you can do the following:

Quote
The following command changes the internal IPTC encoding to UTF-8:
   exiftool -tagsfromfile @ -iptc:all -codedcharacterset=utf8 {File.jpg}
and this command changes it back from UTF-8 to Windows Latin1 (cp1252):
   exiftool -tagsfromfile @ -iptc:all -codedcharacterset=  {File.jpg}
or this command changes it back from UTF-8 to Windows Latin2 (cp1250):
   exiftool -tagsfromfile @ -iptc:all -codedcharacterset= -charset iptc=latin2  {File.jpg}


Unfortunately, I can't reproduce this, when I try the following:

0. Initial:

Code: [Select]
IPTC:CodedCharacterSet ... utf8
IPTC:{TagName} ........... Umlaute äöüß
..................(Binary: Umlaute äöüß)


1. Execute: ExifTool -tagsFromFile @ -IPTC:All -CodedCharacterSet= {Image file}

Expected result:
Code: [Select]
IPTC:CodedCharacterSet ... {n.a.}
IPTC:{TagName} ........... Umlaute äöüß
..................(Binary: Umlaute äöüß)

Actual result:
Code: [Select]
IPTC:CodedCharacterSet ... {n.a.}
IPTC:{TagName} ........... Umlaute äöüß
..................(Binary: Umlaute äöüß)

Why stays IPTC:{TagName} UTF8 encoded and isn't converted to Latin1?


2. Execute: ExifTool -tagsFromFile @ -IPTC:All -CodedCharacterSet=utf8 {Image file}

Converting back to UTF8 will change apparently nothing.
Actual result:
Code: [Select]
IPTC:CodedCharacterSet ... utf8
IPTC:{TagName} ........... Umlaute äöüß
..................(Binary: Umlaute äöüß)


And just out of curiosity:

3. Execute: ExifTool -IPTC:CodedCharacterSet= {Image file}

Actual result:
Code: [Select]
IPTC:CodedCharacterSet ... {n.a.}
IPTC:{TagName} ........... Umlaute äöüß
..................(Binary: Umlaute äöüß)

Apparently it is a bad idea just to delete the IPTC:CodedCharacterSet tag...

Thanks a lot in advance,
greetings, van Dusen

Title: Re: How to write Latin1-encoded IPTC-values?
Post by: Phil Harvey on May 31, 2011, 11:44:44 AM
You can write IPTC in whatever encoding you like.

I think that reading FAQs number 10 and 18 (https://exiftool.org/faq.html#Q10) may help explain this.

- Phil
Title: Re: How to write Latin1-encoded IPTC-values?
Post by: van Dusen on June 01, 2011, 06:07:03 PM
Hello Phil,

thanks for your quick reply. It was indeed my fault, actually everything works as it should. I had validated the results by extracting the tags using the "-b(inary)" option and I didn't reckon, that a charset conversion is done (here: output had been converted to UTF8 in each case) even if the "-b" option is set (at least for tags other than "Binary" type, I assume). I found, that option "-v4"/"-v5" is better suited for validation purposes.