ExifTool Forum

ExifTool => Bug Reports / Feature Requests => Topic started by: Anonan on July 21, 2019, 09:46:05 AM

Title: Can't open file with surrogate pair or Japanese character in the file name
Post by: Anonan on July 21, 2019, 09:46:05 AM
Is there a way to bypass this problem? Without renaming of files.

cat 1日.png | exiftool does not work too.

I type a file name with auto-complete via Tab.

I use Windows 10, CMD and Git-Bash.

The file with surrogate pair in the name is in the archive.
Title: Re: Can't open file with surrogate pair or Japanese character in the file name
Post by: Hayo Baan on July 21, 2019, 10:06:40 AM
Windows and files with special characters on the command-line is not always working well. This is a known issue but sadly not easy to fix. It's not a fault of exiftool, but mostly of Windows (and a little bit of perl).

But, your work-around using cat should have worked. But I think you forgot to tell exiftool to read from the input: cat 1日.png | exiftool -

Note: your zip file didn't work for me since the filename contains an illegal UTF-8 byte sequence (I'm on a Mac, not Windows). How did you create that zip?
Title: Re: Can't open file with surrogate pair or Japanese character in the file name
Post by: Anonan on July 21, 2019, 10:18:31 AM
Quote from: Hayo Baan on July 21, 2019, 10:06:40 AM
cat 1日.png | exiftool -

Thanks.
It works for me. For the file with sur-pair too.

Quote from: Hayo Baan on July 21, 2019, 10:06:40 AM
Note: your zip file didn't work for me since the filename contains an illegal UTF-8 byte sequence (I'm on a Mac, not Windows). How did you create that zip?
I have created this zip with 7-zip.
Windows (NTFS) uses UTF-16 for file names.


Title: Re: Can't open file with surrogate pair or Japanese character in the file name
Post by: Anonan on July 21, 2019, 10:25:49 AM
For CMD:
type "1日.png" | exiftool -
Title: Re: Can't open file with surrogate pair or Japanese character in the file name
Post by: Anonan on July 21, 2019, 12:38:39 PM
If you wanna test it yet:
The link to the image without archiving: https://mega.nz/#F!FkpzmQyD!AFe8lD6Hu7DxOEYEIobmRA
Title: Re: Can't open file with surrogate pair or Japanese character in the file name
Post by: Hayo Baan on July 22, 2019, 02:32:28 AM
Yes, with the original files that works, of course. But as said, I'm on a Mac which supports/uses UTF8 filenames:
$ exiftool -s -a -G0:1 [12]?.png
(https://exiftool.org/forum/index.php?action=dlattach;topic=10321.0;attach=3193)
(posted as image as the droplet character wouldn't render as "code".