ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: Lagrandeimage on November 28, 2020, 05:55:37 PM

Title: Pb with accented characters in Exiftool output file
Post by: Lagrandeimage on November 28, 2020, 05:55:37 PM
Hello all,

I have a command (thanks the forum) that allows me to output in a file all the keywords of files. It it the following command :

exiftool -keywords -L -sep "\n" -sep "\n" -r -b *.jpg > out.txt

It works great except for one detail.

For accented characters (I'm French) I get gibberish instead.

What argument can I use to correct this?

Thanks in advance.

Cheers
Title: Re: Pb with accented characters in Exiftool output file
Post by: StarGeek on November 28, 2020, 06:56:56 PM
I'm assuming Windows, so this would be FAQ #18 (https://exiftool.org/faq.html#Q18).  Basically, Windows command line doesn't deal well with non-ascii characters.

Alternatively, if you're using Windows 10, you could set the system locale to UTF8, as per this StackOverflow answer (https://stackoverflow.com/questions/57131654/using-utf-8-encoding-chcp-65001-in-command-prompt-windows-powershell-window/57134096#57134096). 

The FAQ answer never worked for me but the StackOverflow one does, but you may see some weirdness in other places.  For example, in the Ditto clipboard manager, some characters are displayed as this character �, but paste from the clipboard correctly.
Title: Re: Pb with accented characters in Exiftool output file
Post by: Lagrandeimage on December 01, 2020, 03:41:03 PM
Hi,

Thank you for your reply.

Using the -charset filename=utf8 (as per the FAQ) in the command solved the problem, all characters in my output file are now ok.

Thanks a lot!