Hi Phil
We have a problem with updating metadata i would like to ask you about.
If i write "Hej mitt namn ar Bennie" to -iptc:Headline i get the input "Hej mitt namn ar Bennie" in the XML data. I like that
The problem is if i use a swedish letter like ä example: "Hej mitt namn är Bennie" then i get a base64 encoded string instead.
Without ä <IPTC:Headline>Hej mitt namn ar Bennie</IPTC:Headline>
With ä <IPTC:Headline rdf:datatype='http://www.w3.org/2001/XMLSchema#base64Binary'>aGVqIGhvcHBu5HJnZXIgc25vcHA=</IPTC:Headline>
we do not want exiftool to make it a base64. How can we do that and why is it base64 encoded?
This works for me here (ExifTool 8.91, Mac OS X):
> exiftool a.jpg -iptc:headline='Hej mitt namn är Bennie'
1 image files updated
> exiftool a.jpg -iptc:headline -X
<?xml version='1.0' encoding='UTF-8'?>
<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'>
<rdf:Description rdf:about='a.jpg'
xmlns:et='http://ns.exiftool.ca/1.0/' et:toolkit='Image::ExifTool 8.91'
xmlns:IPTC='http://ns.exiftool.ca/IPTC/IPTC/1.0/'>
<IPTC:Headline>Hej mitt namn är Bennie</IPTC:Headline>
</rdf:Description>
</rdf:RDF>
What version of ExifTool are you using? Also, it may help you you post your exact command line and a small test image that illustrates the problem.
- Phil
We are using 8.7.7 but i just tired and its the same with the latest function.
"c:\temp\image.jpg" -iptc:Headline="Hej mitt namn är Bennie"
This is the command that is runed, the only differens is that we have built a software that gets the string from a mssql db. Something like this:
-iptc:Headline="<mssql default="{iptc:Headline}" connection="server=192.168.81.248\MSSQL;uid=sa;pwd=**********;database=******;pooling=false" command="SELECT Head from [MyDb] Where userid = {iptc:Credit} " />"
The <mssql> tag is replaced by its returning value that is "Hej mitt namn är Bennie".
I'm guessing that your string isn't valid UTF-8. ExifTool will encode in base64 if the value isn't valid UTF-8. You should carefully check the encoding of the strings from your mssql db.
- Phil
I was right. I unpacked the base64 you posted, and the character "ä" is encoded as E4 hexadecimal, which is not UTF-8. It should be encoded as C3 A4.
This may happen if the IPTC encoding is incorrect, which is a common problem with IPTC. See FAQ number 10 (https://exiftool.org/faq.html#Q10) for some help with coded character sets.
- Phil
We tried that but solved the problem running HTML encoding as you recommended in another post.
Thank you for your help again phil. U the m(E4 hexadecimal)n!