UTF8 encoding for tag "artist"

Started by Jossie, October 11, 2017, 03:54:14 AM

Previous topic - Next topic

Jossie

Hello,

with EXIFtool-GUI all tags are UTF8-encoded, according to the documentation. Exporting the tags into a text file I see that the "artist" tag is always ANSI-encoded, whatever I do. Why is that?

Hermann-Josef

Phil Harvey

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

Jossie

Hi Phil,

thanks for pointing to the solution.

May I add another question?

The tags "LocationShown..." and "LocationCreated..." are in many cases identical. So I fill in only one and want to copy the content to the other. However, only "LocationShownCity" is copied to "LocationCreatedCity" by the following sequence in the args-file of the GUI:

-XMP-iptcExt:LocationCreatedSublocation < -XMP-iptcExt:LocationShownSublocation
-XMP-iptcExt:LocationCreatedCity < XMP-iptcExt:LocationShownCity
-XMP-iptcExt:LocationCreatedProvinceState < -XMP-iptcExt:LocationShownProvinceState
-XMP-iptcExt:LocationCreatedCountryName < -XMP-iptcExt:LocationShownCountryName

The others are not copied. What am I doing wrong here?

Best wishes

Hermann-Josef

Phil Harvey

Hi Hermann-Josef,

You have an extra "-" that shouldn't be there after the "<" on three of the lines.  (Using the -v2 option may have helped you to figure this out.)

But it would be better to copy this entire structure at once, like this:

-XMP-iptcExt:LocationCreated < XMP-iptcExt:LocationShown

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

Jossie

Hi Phil,

thanks a lot and sorry that I was blind! I had stared at these code lines over and over and did not see the minus sign, wherever this came from.

And thanks for pointing out how to do it more elegantly.

Hermann-Josef

Phil Harvey

Quote from: Jossie on October 11, 2017, 08:18:10 AM
thanks a lot and sorry that I was blind! I had stared at these code lines over and over and did not see the minus sign, wherever this came from.

I didn't see it either (BTW, this is common mistake 5a), but I used the -v2 option which told me that ExifTool was trying to delete some values, which was a good clue.

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

Jossie

I will keep the -v2 option in mind, that is for sure!

Hermann-Josef

Jossie

Good evening,

may I just continue with this thread, as I am still having problems with the encoding.

I use geosetter to retrieve geo-data and based on these the name of the location (city, state ...). Obviously there is an encoding problem, since I do get the following appearance for words with German umlauts if I export the tags with exiftool-gui as a text file:

---- IPTC ----
City                            : Schöntal

However, the photoshop tag appears correct:

---- XMP-photoshop ----
Schöntal

If I copy the tag in the exiftool gui into the clipboard and paste it into a txt-file, I get the following:

Schöntal

which is different from the export as a text file.

I have also tried the following exiftool command to replace the strings:

-XMP-iptcExt:LocationShownCity<${XMP-iptcExt:LocationShownCity;tr/ö/ö/

but it did not work.

So I am lost here and do not know how to correct the umlaut symbols correctly into their UTF8 encoding.

Many thanks in advance for any hints on how to proceed.

Hermann-Josef

StarGeek

Check FAQ 18 and probably FAQ 10

tl;dr, Windows command line doesn't handle UTF8 very well.  Adding -L may help.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Jossie

Thank you very much for your fast reply.

I have looked at the FAQs but it did not help. I think it is not a question of properly displaying but I have to replace the Umlauts as delivered by geosetter into the proper UTF8 encoded characters. As I had written using the tr did not help. So there must be another way to exchange the umlaut characters. But which?

I have also tried to save the exported tags as a text file and store it in UTF8 encoding. But this changed nothing.

Hermann-Josef



Phil Harvey

Hi Hermann-Josef,

Quote from: Jossie on October 13, 2017, 12:54:11 PM
---- IPTC ----
City                            : Schöntal

Yes.  IPTC character coding is problematic unless IPTC:CodedCharacterSet is UTF8.

QuoteI have also tried the following exiftool command to replace the strings:

-XMP-iptcExt:LocationShownCity<${XMP-iptcExt:LocationShownCity;tr/ö/ö/

but it did not work.

Why are you writing XMP?  Your problem was with IPTC:City.

My guess is the IPTC:City is OK, but in the wrong encoding.  If IPTC:CodedCharacterSet isn't set in the file, then use -charset iptc=CHARSET to specify the proper character set.  But if CodedCharacterSet exists in the file and is set to "UTF8", then City isn't encoded properly.  In this case, delete CodedCharacterSet then try various character sets with -charset iptc=CHARSET until you find the right one, then recode it to UTF8 with a command like this (like the example from FAQ 10):

exiftool -tagsfromfile @ -iptc:city -codedcharacterset=utf8 -charset iptc=CHARSET FILE

After you do this, it should display properly.

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

StarGeek

I would suggest upgrading Geosetter to 3.4.53 beta.  This adds an IPTC coding section to the File menu.  I haven't changed it and when I added Schöntal to a file using the defaults, it was encoded properly.

You can get the beta by selecting Help Menu -> Check for updates.  There will be a link in the window that appears.

Using tr won't help fix the error, as that translates single characters.  Try s/ö/ö/g instead and add the -L option if you haven't changed your code page as mentioned under FAQ 18.

I've encountered this problem often with the © symbol.  Some software out there writes it so badly, that it gets expanded three times.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Jossie

Hello,

sorry for the late response -- we were traveling over the weekend.

Thanks a lot for the various hints!

The new version of geosetter with the default setting is the way to go. The only thing to do after the import of the geographic data is to set the tag for the encoded character set to UTF8 in EXIFtool-GUI. Once this is done all is looking fine. Also in PhotoShop and IrfanView the tags are displayed correctly. Very nice!

Hermann-Josef