charset and DateTime

Started by joerg128, May 03, 2021, 05:50:25 AM

Previous topic - Next topic

joerg128

Hello,
I have the following problem:
first I use LANG=de_DE.UTF-8

if I ask for DateTimeOriginal I get
exiftool -d %Y-%m-%b FILE
2019-03-M?r

but for renaming the file I get
exiftool -d %Y-%m-%b '-filename<DateTimeOriginal' FILE
2019-03-Mär[|code]

Why this two different results?
What can I do?
Regards
Jörg

Phil Harvey

Hi Jörg,

Here is what I get in sh on Mac:

$ printenv LANG
de_DE.UTF-8
$ exiftool -createdate -d %Y-%m-%b a.jpg
Create Date                     : 2021-03-Mär
$ exiftool '-filename<$createdate.%e' -d %Y-%m-%b -v a.jpg
======== a.jpg
Setting new values from a.jpg
'a.jpg' --> '2021-03-Mär.jpg'
    1 image files updated
$ ls -l 2021*
-rw-r--r--@ 1 phil  staff  437  3 Mai 07:50 2021-03-Mär.jpg
$ exiftool -ver -v
ExifTool version 12.25
Perl version 5.018004 (-C0)
Platform: darwin
Optional libraries:
  Archive::Zip                 1.37
  Compress::Zlib               2.06
  Digest::MD5                  2.52
  Digest::SHA                  5.84_02
  IO::Compress::Bzip2          2.060
  POSIX::strptime              0.13
  Time::Local                  1.2300
  Unicode::LineBreak           2016.003
  IO::Compress::RawDeflate     2.060
  IO::Uncompress::RawInflate   2.060


- 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 ($).

joerg128

Dear Phil,
thank you for your fast response.
It seems that I have differences in the libraries. I installed exiftool via the DMG from your website.
Here are the output of exiftool -ver -v


ExifTool version 12.25
Perl version 5.030002 (-C0)
Platform: darwin
Optional libraries:
  Archive::Zip                 1.68
  Compress::Zlib               2.084
  Digest::MD5                  2.55
  Digest::SHA                  6.02
  IO::Compress::Bzip2          2.084
  Time::Piece                  1.33
  Time::Local                  1.28
  Unicode::LineBreak           (not installed)
  IO::Compress::RawDeflate     2.084
  IO::Uncompress::RawInflate   2.084


-Jörg

Phil Harvey

Hi Jörg,

I suggest you install POSIX:strptime if possible.  My guess is that Time::Piece isn't handling locales properly.  ExifTool will use the POSIX library if it exists.

- 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 ($).

joerg128

Hey Phil,

sorry, unfortunately no success
I installed POSIX::strptime and Unicode::LineBreak

ExifTool version 12.25
Perl version 5.030002 (-C0)
Platform: darwin
Optional libraries:
  Archive::Zip                 1.68
  Compress::Zlib               2.084
  Digest::MD5                  2.55
  Digest::SHA                  6.02
  IO::Compress::Bzip2          2.084
  POSIX::strptime              0.13
  Time::Local                  1.28
  Unicode::LineBreak           2019.001
  IO::Compress::RawDeflate     2.084
  IO::Uncompress::RawInflate   2.084

It seem, that renaming and output of parameters are using different libraries.

Joerg