Ignoring local characters in new version

Started by krzysiu, August 13, 2024, 05:33:31 PM

Previous topic - Next topic

krzysiu

Hey,
Exiftool 12.92
Windows 10 (en locale)

I was using own script for moving files. It was all fine with exiftool 12.8x (I'm not sure which one exactly). When I moved to 12.92, using command like
exiftool -charset utf-8 -Directory="D:\_FOTO\_POSORTOWANE\Rośliny\Rośliny naczyniowe\Asteraceae (astrowate)\Stokrotka łąkowa (bellis perennis)" -overwrite_original -P -@ C:\Users\Krzysiu\AppData\Local\Temp\tagC53B.tmp D:\_FOTO\_LISTED\20-05-19\IMG_4563_GPS.CR2with C:\Users\Krzysiu\AppData\Local\Temp\tagC53B.tmp
-RawImageDigest<$imagedatamd5
-title=stokrotka pospolita (bellis perennis)
-description=asterales
-XMP:copyright=kingdom?rośliny#phylum?rośliny naczyniowe#class?magnoliopsida#order?astrowce#family?astrowate#genus?stokrotka#species?stokrotka łąkowa
-source=20-05-19

Moves it to D:\_FOTO\_POSORTOWANE\Rosliny\Rosliny naczyniowe\Asteraceae (astrowate)\Stokrotka lakowa (bellis perennis)

Some Polish characters gets translated (ł>l, ą>a etc.). The XMP copyright tag (which I shamelessly use for taxa, instead DarwinCore) is fine. This happens with every file I want to move.

I tested it with random file and command
exiftool -directory=d:\Żółć "D:\_FOTO\_LISTED\IMG_5495.jpg". It moved it to d:\Zólc (note ó is fine, rest is translated).

Output is the same, as back when it worked:
Warning: FileName encoding not specified - D:/_FOTO/_LISTED/IMG_5495.jpg
    1 directories created
    1 image files updated
"We would use teleporters and live on another planets, if only ExifTool would be present when I was researching cosmos and physics"
Albert Einstein

Phil Harvey

If 12.87 works for you and 12.88 does not (ie. the new package version), then we have a problem that may be difficult to fix.

Could you try version 12.87 and 12.88 under the same conditions to see if they behave differently?

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

FrankB

#2
Maybe you need to add:
-CHARSET
FILENAME=UTF8
-API
WindowsWideFile=1

I tried to reproduce it in ExifToolGui, it has that enabled by default, and that looks OK.

Edit:
- WindowsWideFile added.
- Gui has another problem, it doesn't handle files getting moved to other directories

krzysiu

The latter doesn't help:
D:\>exiftool -CHARSET FILENAME=UTF8 -API WindowsWideFile=1 -Directory=d:\żółć IMG_5495.jpg
Warning: Malformed UTF-8 character(s) - IMG_5495.jpg
Error: Error creating 'd:/z≤lc/IMG_5495.jpg' - IMG_5495.jpg
    1 directories created
    0 image files updated
    1 files weren't updated due to errors

D:\>chcp 65001
Active code page: 65001

D:\>exiftool -CHARSET FILENAME=UTF8 -API WindowsWideFile=1 -Directory=d:\żółć IMG_5495.jpg
Warning: Malformed UTF-8 character(s) - IMG_5495.jpg
Error: Error creating 'd:/zlc/IMG_5495.jpg' - IMG_5495.jpg
    1 directories created
    0 image files updated
    1 files weren't updated due to errors

Apparently it doesn't work anymore with old versions as well. I totally forgot I changed Windows locale recently and codepage got changed as well (to 437). When I set it to 852 (my old one) or 65001 (pseudo Unicode) it's always the same. With our without "-CHARSET FILENAME=UTF8 -API WindowsWideFile=1". Any recommendations what I could do now? Or ideas what else has changed when I switched locale? If there's no simple solution, I'll just create dir myself and move it using built in scripting language fn.

Geez, I have enough of Windows codepages. This temp file from the first post was already a workaround.
"We would use teleporters and live on another planets, if only ExifTool would be present when I was researching cosmos and physics"
Albert Einstein

FrankB

Quote from: krzysiu on August 14, 2024, 09:32:28 AMAny recommendations what I could do now?

Yes, I have 1 more thing you could try.

You're using a 'tmp' file with commands in your first post.
-@ C:\Users\Krzysiu\AppData\Local\Temp\tagC53B.tmp
- Make sure the file is saved as UTF-8.
- Put the -Directory= in that 'tmp' file, and not as a parameter on the command line.

In the Tmp (Args) file it should be something like: (Without double quotes)
-directory=d:\Żółć
I have attached screenshots of ExifToolGui and the generated CMD file by ExifToolGui

gui.jpg

Output of the Cmd file. (And yes the directory is created and the file is there)

cmdprompt.jpg

@echo off
chcp 65001
set ARGS="%TEMP%\exiftool.args"
(
echo #### Generated by ExifToolGui #####
echo -echo4
echo {ready22}
echo -CHARSET
echo FILENAME=UTF8
echo -CHARSET
echo UTF8
echo -v0
echo -overwrite_original
echo -sep
echo *
echo -m
echo -c
echo %%.6f°
echo -API
echo WindowsWideFile=1
echo -API
echo GeoDir=C:\Program Files\ExifToolGUI\GeoLocation500
echo -directory=c:\user\Żółć
echo htmldump.html
echo -execute22
) > %ARGS%
exiftool  -@ %ARGS%
del %ARGS%
pause


StarGeek

You could always try this StackOverflow answer (reboot required). I haven't had a problem with any non-ASCII characters since setting it.

PS C:\> exiftool -directory=%dŻółć Y:\!temp\x\y\Test4.jpg
    1 directories created
    1 image files updated

PS C:\> tree Y:\!temp\x\y\ /f
Folder PATH listing for volume DrivePool
Volume serial number is 000000C6 3881:4F27
Y:\!TEMP\X\Y
└───Żółć
        Test4.jpg

PS C:\>
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).