How to write any symbol with exiftool?

Started by Jenis, December 30, 2018, 02:39:59 PM

Previous topic - Next topic

Jenis

I found that when I use special characters exiftool doesn't work:
exiftool -All= -overwrite_original -m -q -q -ImageDescription="Oukitel C8 5.5" 18:9 Infinity Display" -XPTitle="Oukitel C8 5.5" 18:9 Infinity Display" -XPComment="Oukitel C8 5.5" 18:9 Infinity Display" -XPKeywords="Oukitel C8 5.5" 18:9 Infinity Display" -XPSubject="Board" -Title="Oukitel C8 5.5" 18:9 Infinity Display" -Description="Oukitel C8 5.5" 18:9 Infinity Display" -Rating="5" -RatingPercent="99" -LastKeywordXMP="Oukitel C8 5.5" 18:9 Infinity Display" "c:\1.jpg"
How should I modify this line to be able to write any symbols like \,/,?,",| and so on?

StarGeek

Assuming you're using Windows, the problem is that you're embedding a double quote.  Otherwise, there's no problems adding slashes (regular or backslash), question marks, or pipe characters.

When CMD encounters something like -ImageDescription="Oukitel C8 5.5" 18:9 Infinity Display", it matches each quote with the next one, so in this case, ImageDescription gets assigned the value "Oukitel C8 5.5".  This will mess up the following commands as Windows will keep matching quotes.

What you need to do is escape the double quotes.  I believe the official way is to triple any double quotes to embed them.  So -ImageDescription="Oukitel C8 5.5" 18:9 Infinity Display" would need to be changed to -ImageDescription="Oukitel C8 5.5""" 18:9 Infinity Display".  See this StackOverflow answer for more details.  In my experience, \" can also work, though there does seem to be a point of failure if you have too many of them.

Another option is to use the -E (escapeHTML) option.  Where ever you want to add the double quote, you put the html entity " instead and add -E the command, e.g. -E -ImageDescription="Oukitel C8 5.5" 18:9 Infinity Display".
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype