Cannot Display Unicode Characters Correctly

Started by robert l. a., September 11, 2013, 01:26:06 PM

Previous topic - Next topic

robert l. a.

I have an image that has unicode characters inside the IPTC Caption-Abstract field. I ran

exiftool -codedcharacterset=utf8 img1.jpg

It returns "1 image files updated". I then tried to display the the caption-abstract field so I executed

exiftool -iptc:caption-abstract  -charset iptc=UTF8 img1.jpg

and it still does not display the unicode characters correctly. I am running this from a Windows 7 command prompt. I also set the font to Lucida Console and set chcp 65001 per FAQ 18. But it still does not show the unicode characters correctly.

It shows the text like this: 20� x 16", Oil on Linen, 2011...

But it should show the text instead like this: 20" x 16", Oil on Linen, 2011...

Any help would be greatly appreciated!

Phil Harvey

Can you get this character to display properly in the cmd window?  I don't think this is an IPTC problem.  More likely that your font doesn't have a definition for this character.

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

robert l. a.

Hi Phil,

Thanks for replying. Actually, what's interesting is that the character (") displays fine in the XMP:Description field. You see, we used light room to edit the description field and the software then populates both the XMP:Description field and the IPTC:Caption-Abstract field. So yes, the character does display correctly in the cmd window but for the XMP:Description field but it shows the junk character for the IPTC:Caption-Abstract field.

I attached a screen capture of my cmd window.

Phil Harvey

OK then.  The answer is simple.  If CodedCharacterSet is set properly, then the problem is that the character isn't encoded in UTF-8 in the IPTC.  Try writing the tag again now that CodedCharacterSet has been set.

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

robert l. a.

Ahh, you're good! It looks like the photo software (Photoshop) used to write in the Caption-Abstract field used the MacRoman character set. Thanks for all of your help!