Command-line - Windows : fight against character encoding problem or accept it?

Started by sylf, December 12, 2021, 11:03:57 AM

Previous topic - Next topic

sylf

Hi.
Very happy with Exiftool delivering nice XML metadata files.
Concerning the encoding of characters, these two output examples :
<IPTC2:Caption-Abstract>Degustation d&#39;une Barrique</IPTC2:Caption-Abstract>
"d&#39;" should be "d'"
<IPTC2:DocumentHistory>r23 mai 2003 10:31:54  Texte enregistrŽ</IPTC2:DocumentHistory>
"enregistrŽ" should be "enregistré"
I read topic https://exiftool.org/faq.html#Q10. But it is a little too tricky for me. Let's say I'd like to use this command :
exiftool.pl -@ C:\dir1\dir2\list_of_image_paths.txt -X -w C:\dir3\dir4\%f.xml
Would you suggest me to test a specific parameter to get the right encoding : "d'" and "enregistré"?
Or is this so tricky that I would better live with this encoding problem?
Best,
Sylvain

StarGeek

FAQ #18 is the relevant FAQ since you're on Windows.  The problem is Windows command lines don't handle different character encoding well.  Try the options in that FAQ and see if that helps.

Another thing to try is this StackOverflow answer, but that route can have side effects on the fonts in older programs which may mess up some GUIs.

But with regards to &#39;, that shouldn't be a problem as that is just the single quote encoded as an XML entity.  See Predefined entities in XML Wikipedia page. Any program that correctly reads XML should read that correctly.
"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