ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: Schmidtze on July 24, 2017, 05:27:23 AM

Title: Arg file with unicode filenames
Post by: Schmidtze on July 24, 2017, 05:27:23 AM
Hi,

I already found this topic:
https://exiftool.org/forum/index.php/topic,5449.msg26392.html#msg26392 (https://exiftool.org/forum/index.php/topic,5449.msg26392.html#msg26392)

I think my problem is similar to this, but maybe something changed in the meantime, so I'm asking again. My arg file may contain filenames with different character sets like

c:\äöüß.jpg
c:\日本語.jpg


For me it seems now, that this isn't possible. As you mentioned already that for example UTF-8 will not be decoded by ExifTool and Windows itself doesn't understand UTF-8 regarding the filenames too. Am I right? Or is there a solution maybe for this problem?

Many thanks in advance and best regards
Friedemann
Title: Re: Arg file with unicode filenames
Post by: Phil Harvey on July 24, 2017, 07:00:23 AM
Hi Friedemann,

Yes, things have changed.

Since ExifTool 9.79 (Jan 2015) you can use -charset filename=utf8 with UTF-8 encoded file names in your argfile.

- Phil
Title: Re: Arg file with unicode filenames
Post by: Schmidtze on July 24, 2017, 08:40:25 AM
Hi Phil,

oh, what a surprise, perfect!!!  :) It works  :)

Many many thanks
Friedemann
Title: Re: Arg file with unicode filenames
Post by: Schmidtze on July 25, 2017, 06:54:49 AM
See also here: https://exiftool.org/exiftool_pod.html#WINDOWS-UNICODE-FILE-NAMES (https://exiftool.org/exiftool_pod.html#WINDOWS-UNICODE-FILE-NAMES)  :)
Title: Re: Arg file with unicode filenames
Post by: dma_k on March 20, 2018, 08:08:09 PM
I have the similar problem when using Exiftool under Cygwin on Windows:

C:\> perl /usr/local/bin/exiftool -G "Château.jpg"
File not found: "Château.jpg"

When I remove the quotes, everything works fine:

C:\> perl /usr/local/bin/exiftool -G Château.jpg
[ExifTool]      ExifTool Version Number         : 10.55
...

But if filename contains a space, it does not work as needs inclusion into quotes...
I think it has something to do with Perl (the way it pre-process @ARGV) or CMD. Maybe somebody has an idea?
Title: Re: Arg file with unicode filenames
Post by: Phil Harvey on March 20, 2018, 09:57:33 PM
Wow, that is odd.  You can do partial quoting if necessary:

C:\> perl /usr/local/bin/exiftool -G Château" with spaces.jpg"

- Phil
Title: Re: Arg file with unicode filenames
Post by: dma_k on March 22, 2018, 06:28:53 PM
After some research it turned out to be the matter of how cygwin1.dll processes command line. The problem affects all Cygwin binaries, not only perl, see this thread (https://cygwin.com/ml/cygwin/2018-03/msg00363.html).

The cure is to set the environment variable and then everything magically started to work:

C:\> set LANG=en_GB.UTF-8
C:\> perl /usr/local/bin/exiftool -G "Château.jpg"
[ExifTool]      ExifTool Version Number         : 10.55
...

I have set the variable as global environment variable.
Title: Re: Arg file with unicode filenames
Post by: Phil Harvey on March 22, 2018, 09:35:11 PM
Ah.  Glad you found the solution.

- Phil