ExifTool Forum

ExifTool => Newbies => Topic started by: Happy User on January 12, 2013, 12:23:24 PM

Title: character encoding
Post by: Happy User on January 12, 2013, 12:23:24 PM
Hello,

First of all, I honestly tried to read the documentation, and, I have to admit, that I didn't understand much and the words there looked like magic spells to me. Because I am that smart, probably.

The problem is, that after using Picasa for a while, I switched to Shotwell. I think, the iptc tags were in CP1251 and now they are in CP1252.  Now in Keywords Shotwell and Phatch see nothing and exiftool sees "Àìåðèêà" . I'm trying to convert it back.

I use: exiftool -charset iptc=cyrillic DSC04383.JPG and I see "Америка" in the output.
So, I use: exiftool -tagsfromfile @ -iptc:all -codedcharacterset= -charset iptc=Cyrillic DSC04383.JPG and i get the same "Àìåðèêà" in the Keywords tag. Only now it is in CP1251, I suppose. Anyway, I'm lost. Help me, please.

Thank you very much.
Title: Re: character encoding
Post by: Phil Harvey on January 12, 2013, 12:47:57 PM
I see you have read FAQ 10 (https://exiftool.org/faq.html#Q10).  Great.

I would not advise using any character set other than UTF-8 in IPTC because software has no way to tell what the character set was.  Also, CP1252 probably doesn't support some characters you require anyway.  So I would suggest following the example in FAQ 10 and converting to UTF-8, but as you discovered you need to add -charset iptc=Cyrillic (or -charset iptc=cp1251, or -charset iptc=russian) to read the existing IPTC correctly:

exiftool -tagsfromfile @ -iptc:all -codedcharacterset=UTF8 -charset iptc=cp1251 DSC04383.JPG

This should generate IPTC readable by any application that understands UTF-8 encoding.

BTW: You shouldn't feel bad.  The IPTC character encoding is confusing!

- Phil
Title: Re: character encoding
Post by: Happy User on January 13, 2013, 01:45:36 AM
Now I feel great. Thank you.