Windows & UTF-8 & IPTC

Started by pluto007, November 03, 2011, 05:28:33 PM

Previous topic - Next topic

pluto007

Hello Phil,

I read about the theme in the FAQs and the threads but can't get it working.
1. I have filenames like "Elfenbeinküste.jpg"
2. I write them in the IPTC field caption via exiftool "-Caption-Abstract<myDescription"
3. I get IPTC-captions like "Elfenbeink"

If I change 2. to exiftool -charset cp1252 "-Caption-Abstract<myDescription" I get the correct IPTC caption. (Windows codepage does'nt matter whether it is set to 850 1252 or 65001)
If I change 2. to exiftool -charset cp65001 "-Caption-Abstract<myDescription" I get "Elfenbeink" (Windows codepage does'nt matter whether it is set to 850 1252 or 65001)
If I change 2. to exiftool -charset cp850 "-Caption-Abstract<myDescription" I get "Elfenbeink" (Windows codepage does'nt matter whether it is set to 850 1252 or 65001)

The problem is I NEED UTF-8 or default Windows codeset 850 AND the correct caption "Elfenbeinküste"... for the gallery (TWG) because TWG does convert IPTC data to UTF-8 by default or leave the IPTC data as it is (if a special parameter is set).

Do you have any ideas what I could try or do?

Thank you very much
pluto
I

Phil Harvey

Hi Pluto,

This has a chance of writing the text as UTF-8, which I think is what you want.

exiftool -charset cp1252 -codedcharacterset=UTF8 "-Caption-Abstract<myDescription" ...

- 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 ($).

pluto007

Hello Phil,

I will give it a try this evening.

pluto

pluto007

Hello Phil,

do you know how to check whether the IPTC field caption is now filled with text in UTF-8 format?
I can see the correct spelling at the moment in irfan view , but don't know if the new parameter works or not because the gallery still shows garbage... ;-(

Attached you'll find a JPEG filled with the command: exiftool -charset cp1252 -codedcharacterset=UTF8 "-caption...

Thank you very much
pluto

BogdanH

Hi,

You can check your files (how they are encoded) by executing:
exiftool -f -Iptc:CodedCharacterset *.jpg

Now, there's one thing you should be aware of: when you first time execute command like
exiftool -charset cp1252 -codedcharacterset=UTF8 Iptc:Caption-Abstract="meine küste" myFile.jpg
then other tags, that might already exist inside Iptc, are not converted into UTF8.

Bogdan

Phil Harvey

Pluto,

Yes, Caption-Abstract seems to be written correctly in UTF8.

Bogdan is correct.  If IPTC already exists you would have to convert all existing values to UTF8 when writing CodedCharacterSet, which can be done in the same command, like this:

exiftool -charset cp1252 -tagsfromfile myFile.jpg -iptc:all -codedcharacterset=UTF8 "-Caption-Abstract<myDescription" myFile.jpg

- 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 ($).

pluto007

Hello Bogdan
hello Phil,

I got it now thank you both of you!

pluto