ExifTool Forum

ExifTool => Bug Reports / Feature Requests => Topic started by: jorese on June 28, 2022, 04:55:15 PM

Title: Odd -charset option problem
Post by: jorese on June 28, 2022, 04:55:15 PM
Tested on Windows 10/11 and Server 2016/2019
Exiftool -ver: 12.42

We use the -@ ARGFILE option to proccess a few images to keep in sync with a database
The ARGFILE is produced in latin1 charset (we can not get a correct utf8 file due to bug in output system..)
The ARGFILE looks something close to

#Orginal image
-DateTimeOriginal=2022:06:20 15:03:34
-ImageUniqueID=35dbaab7-f0aa-11ec-1111-b8cb29bd3991
-ImageDescription=Ortofoto description 2022 TESTÅÄÖ
-Keywords=TAG1;TAG2
c:/path/to/file/o/2022/06/220620_OF_Project-5cm_3007_thumb_tznf.jpg
-overwrite_original
-preserve
-execute
#Large image
-DateTimeOriginal=2022:06:20 15:03:34
-ImageUniqueID=35dbaab7-f0aa-11ec-1111-b8cb29bd3991
-ImageDescription=Ortofoto description 2022 TESTÅÄÖ
-Keywords=TAG1;TAG2
c:/path/to/file/l/2022/06/220620_OF_Project-5cm_3007_thumb_tznf.jpg
-overwrite_original
-preserve
-execute

The command we use is:
exiftool.exe -charset latin1 @ argfile.dat

From the second file in the argfile we get (the first image do not produce any warning)
Warning: Malformed UTF-8 character(s) - c:/path/to/file...

It seems that the -charset option is "reset" by the -execute row in the argfile
It is not possible to put the -charset option inside the argfile
tried a few variants without luck..

Cheers and thanks for an amazing tool
/J
Title: Re: Odd -charset option problem
Post by: StarGeek on June 29, 2022, 12:40:17 AM
Use the -Common_Args option (https://exiftool.org/exiftool_pod.html#common_args).

exiftool.exe -@ argfile.dat -Common_Args -charset latin1

From the docs on the -execute option (https://exiftool.org/exiftool_pod.html#execute-NUM) (emphasis mine)
     Execute command for all arguments up to this point on the command line (plus any arguments specified by -common_args).  The result is as if the commands were executed as separate command lines