0.51: Display of UTF8 IPTC fields

*** Please report new bugs here! ***

Moderators: XnTriq, helmut, xnview, Dreamer

mahikeulbody
Posts: 140
Joined: Sun Dec 13, 2009 4:54 pm

0.51: Display of UTF8 IPTC fields

Post by mahikeulbody »

use case
set an IPTC field with a value including an accent in a file which doesn't have any IPTC data yet :
exiftool -IPTC:City="Athènes" img.jpg

display img.jpg into XnViewMP 0.51:
IPTC Panel displays City: Athnes
Exiftool Panel displays City: Athènes


My analysis
XnViewMP needs the IPTC field 'Coded Character Set' (in my case UTF8) in order to display correctly the IPTC field into the IPTC panel but it doesn't need it to display correctly the field into the Exiftool panel.

----
XnViewMP 0.51
Ubuntu 12.04 (64 bits)
User avatar
xnview
Author of XnView
Posts: 43995
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: 0.51 display of UTF8 IPTC fields

Post by xnview »

Could you send me the jpeg file? I don't know if EXIFTool write IPTC in utf8 by default...
Pierre.
mahikeulbody
Posts: 140
Joined: Sun Dec 13, 2009 4:54 pm

Re: 0.51 display of UTF8 IPTC fields

Post by mahikeulbody »

According to Exiftool doc the default ExifTool encoding is UTF8.

But IMHO it is not the problem here since the value is correctly displayed into the Exiftool panel of XnviewMP.

If I set an IPTC tag (let say IPTC:City="Athènes") using the IPTC/XMP Editor, the resulting file has two IPTC tags : IPTC:City, of course, but also 'Coded Character Set' tag which is = UTF8. In this case, the IPTC panel displays "Athènes".

But if set the IPTC tag using Exiftool (exiftool -IPTC:City="Athènes" myfile), the file has only the IPTC:City tag, not the 'Coded Character Set' tag (I presume Exiftool doesn't write it since it is the default). In this case, the IPTC panel displays "Athnes". As I suppose you use Exiftool to populate IPTC Panel I don't understand why this panel doens't display the same value as the Exiftool panel.

(Of course I have set IPTC encoding to UTF8 into settings of XnViewMP)
mahikeulbody
Posts: 140
Joined: Sun Dec 13, 2009 4:54 pm

Re: 0.51 display of UTF8 IPTC fields

Post by mahikeulbody »

In fact it is a little bit more complicated : Exiftool assumes UTF8 by default for the values given in parameters, not for the way to store it into the file...

I am doing some tests and I come back later with the result.
mahikeulbody
Posts: 140
Joined: Sun Dec 13, 2009 4:54 pm

Re: 0.51 display of UTF8 IPTC fields

Post by mahikeulbody »

Exiftool doc : The Exiftool default when IPTC:CodedCharacterSet is not defined is Latin.
Exiftool FAQ : Note that unless CodedCharacterSet indicates UTF‑8, applications have no reliable way to determine the IPTC character encoding. For this reason, it is recommended that CodedCharacterSet be set to "UTF8" when creating new IPTC.

So, if I want IPTC tag encoded in UTF8 I have to do : exiftool -charset iptc=UTF8 -IPTC:City="Athènes" img.jpg -CodedCharacterSet=UTF8

I suppose that XnViewMP do it also.

So my problem is solved but that doesn't explain why XnViewMP displays "Athènes" in the Exiftool panel and "Athnes" in the IPTC panel when both CodedCharacterSet doesn't exist into the file and IPTC tag is Latin encoded. May be you don't use the same Exiftool command for each panel.