ExifTool Forum

ExifTool => Bug Reports / Feature Requests => Topic started by: pb on August 09, 2011, 05:23:11 PM

Title: copyright symbol not working with -IFD0:Copyright
Post by: pb on August 09, 2011, 05:23:11 PM
exiftool 8.60, win xp sp3, US English everywhere.

Using the command option -IFD0:Copyright=© by foooooooooo, where the char I entered into the forum edit box after "=" is the actual char code I used and pasted into the command line, results in exiftool reporting the symbol(s) "ü¬" for the "Copyright" field (as shown by exiftoolgui and emacs) or "ⁿ¼" in the windows cmd window if run there.

Using -L or -E (without changing anything else in the command line) does not yield any different results.

I got the copyright character by cutting and pasting from the command line that exiftoolgui was sending to exiftool for the same operation, as reported by sysinternals Process Explorer.  When changing that field with exiftoolgui, the correct symbol gets entered.

I should also mention that I am modifying a jpeg file.

Obviously there is funny stuff going on with charset translation, but I don't know what.  What am I doing wrong?
Title: Re: copyright symbol not working with -IFD0:Copyright
Post by: Phil Harvey on August 09, 2011, 06:22:40 PM
Generating special characters on the Windows console can be particularly harrowing since it depends on your system settings.

Using -E was a great idea, but "©" is the HTML character entity that you should use for this symbol:

exiftool -E "-IFD0:Copyright=© by foooooooooo" FILE

This will put a UTF-8 character symbol in the EXIF Copyright string.  Note that this isn't strictly allowed by the EXIF definition so not all software will display this properly.  But this is allowed by the MWG recommendations.

Use the XMP-dc:Rights tag instead if you want to be able to reliably use special characters in this string.

- Phil
Title: Re: copyright symbol not working with -IFD0:Copyright
Post by: pb on August 09, 2011, 06:39:26 PM
Thanks.  That solves the main problem of how to enter such a char, but it still leaves the mystery of how exiftoolgui is doing it successfully with that char in the apparent command line.  I guess I can ask that in the exiftoolgui section and Bogdan may have an answer.

BTW, as I understand it, there is really no legal requirement to use that symbol, so probably the best approach is to just spell out the word "Copyright" or "(c) Copyright", and avoid the hell of charset lossage.  (I fell into the trap by trying to use the identical command line that exiftoolgui was using, so I could do some debugging of an exiftoolgui problem.)