Author Topic: emojis, DOS 8.3 filename  (Read 168 times)

Yagop

  • Newbie
  • *
  • Posts: 4
emojis, DOS 8.3 filename
« on: March 29, 2019, 10:46:20 PM »
Hello. Right now I use ExifTool 11.33 for Windows.

When there are emojis (or even a single emoji) like smilies and flags for example in the filename, ExifTool will perform its intended tagging action but it converts the image's filename into DOS 8.3 format (all capital letters plus the tilde). One particular metadata I can't tag correctly then, for example is, "-OriginalFileName<${filename;s/\.jpg$//i}", because the short DOS 8.3 filename is tagged instead of the long filename with emojis. I think whatever the tagging job is, ExifTool will always convert to DOS 8.3 filename as long as the original long filename has an emoji.

YouTube for example has some video titles with emojis and I use those video titles as filenames for the thumbnails I downloaded (eg. the hqdefault.jpg, maxresdefault.jpg). And I use ExifTool in a batch file to handle multiple images easily. So if I have many images with emojis, then I won't be able to remember their original long filenames after they are converted to DOS 8.3 format.

Thank you and more power.

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14438
    • ExifTool Home Page
Re: emojis, DOS 8.3 filename
« Reply #1 on: March 30, 2019, 09:37:43 AM »
Thanks for this report, but I don't think there is much I can do about this because of the poor support for special characters in Windows file names in Perl.

You'll have to find some external utility to work around this.  For example, if you could write the filename in UTF8 to a sidecar.txt file, then you could do this in ExifTool:

exiftool "-originalfilename<=%d%f.txt" ...

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

herb

  • Sr. Member
  • ****
  • Posts: 265
Re: emojis, DOS 8.3 filename
« Reply #2 on: March 30, 2019, 11:37:06 AM »
Hello Yagop, hello Phil,

please allow an additional question:
Quote
but it converts the image's filename into DOS 8.3 format
When is this done by Exiftool?

I also use Exiftool 11.33 on a Windows 7 system and exiftool.exe is started with -stay_open by my C++ application.
I did a short test with a filename that contained 1 emoji.
Code: [Select]
exiftool.exe -iptc:header<${filename} testfile.jpg with proper charsets UTF8 for filename and IPTC worked properly.

What did I understand wrong?

Best regards
Herb

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14438
    • ExifTool Home Page
Re: emojis, DOS 8.3 filename
« Reply #3 on: March 30, 2019, 11:02:45 PM »
Quote
but it converts the image's filename into DOS 8.3 format
When is this done by Exiftool?

ExifTool doesn't do this.  It is possible that this is done somehow in the standard libraries that ExifTool uses.

Quote
I also use Exiftool 11.33 on a Windows 7 system and exiftool.exe is started with -stay_open by my C++ application.
I did a short test with a filename that contained 1 emoji.
Code: [Select]
exiftool.exe -iptc:header<${filename} testfile.jpg with proper charsets UTF8 for filename and IPTC worked properly.

I have seen similar problems where the behaviour seems to depend somehow on the system settings.

Yagop: What version of ExifTool are you using?  Newer versions try to use the Windows-specific I/O libraries if possible, rather than the standard libraries.

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

Yagop

  • Newbie
  • *
  • Posts: 4
Re: emojis, DOS 8.3 filename
« Reply #4 on: March 31, 2019, 01:20:17 AM »
Thanks to both of you and your examples/tips. So I just then used an external unicode/UTF8 text file (eg. z.txt) wherein it contains the emoji text, then used "-OriginalFileName<=z.txt". It worked and the emojis are tagged inside but the images with the emoji filenames are still converted to DOS 8.3 format. I'm OK with that since I can still rename them back, for example using ExifToolGUI (just tested now too) to view and copy the emoji tags I just tagged earlier.

My intention is to preserve whatever the filenames are no matter how peculiar (unicode/emoji/etc) at least as tags inside, because I lost a few hard disks before and I lost the filenames of my many files even after recovery. Thus if I could embed the filenames, then I could rename them back.

Yagop: What version of ExifTool are you using?  Newer versions try to use the Windows-specific I/O libraries if possible, rather than the standard libraries.
Right now I use ExifTool 11.33, and Windows 7 64-bit.

Thanks for this report, but I don't think there is much I can do about this because of the poor support for special characters in Windows file names in Perl.
Sad to hear that, but I'm OKwith that if that's the case. A similar emoji case for MKVToolNix where it just recently updated its particular library to handle emojis for the first time.

Again, thanks.

herb

  • Sr. Member
  • ****
  • Posts: 265
Re: emojis, DOS 8.3 filename
« Reply #5 on: March 31, 2019, 11:31:45 AM »
Hello,

@Phil: Thanks for the clarifications.
Just another info: I repeated the test (of my previous post) also with Perl: in detail CitrusPerl 5.24.1 ( and no further package installed) and of cource the Exiftool Perl-package. The decribed error did not occur.

@Yagop: So I would be interested which "environment" you are using that changes the "unicode-filename" to a "dos-8.3-filename"

Thanks and best regards
Herb