Arg file with unicode filenames

Started by Schmidtze, July 24, 2017, 05:27:23 AM

Previous topic - Next topic

Schmidtze

Hi,

I already found this topic:
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

Phil Harvey

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
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Schmidtze

Hi Phil,

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

Many many thanks
Friedemann


dma_k

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?

Phil Harvey

Wow, that is odd.  You can do partial quoting if necessary:

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

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

dma_k

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.

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.

Phil Harvey

Ah.  Glad you found the solution.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).