Getting special characters in directory names ...

Started by BrooksR, May 09, 2025, 10:33:46 AM

Previous topic - Next topic

BrooksR

When I run:
exiftool -r -ext jpg -csv -filename -filemodifydate -datetimeoriginal -directory -IPTC:ObjectName -IPTC:Category -IPTC:Keywords -IPTC:City -IPTC:Sublocation -IPTC:Province-State -IPTC:Caption-Abstract -GPSLatitude -GPSLongitude D:\C4-Brenda >output.csv

in the directory column I'm getting some directory names like:

D:/C4-Brenda/2025-03-30 - Sydney Opera House
D:/C4-Brenda/2025-03-31 - Doonside & Blue Mountains National Park
D:/C4-Brenda/2025-04-06 - Fort Mill

These special characters are not present when I access the foldername in the Windows FileSystemObject.

StarGeek

See FAQ #18, problems with special characters on the Windows command line.

The only thing that ever worked for me was the StackOverflow answer. But doing so may affect GUI layouts in older programs. It also causes problems with ISO-8859-1 (extended ASCII) characters (see How this � symbol is causing MASSIVE code issues).
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

BrooksR

Thanks for the reply and information. 
That FAQ 18 is a long and complicated one.
We just took a trip to New Zealand/Australia and it seems only those folders have the special characters.  Not sure why that is.
I do work in VBA and there is a Replace command for swapping out characters.  I could try to find the ASC values for those characters and try replacing them with a space (ASC=32).
Any thoughts on that idea?
Brooks

BrooksR

Will adding -charset exif=utf8 to the command line fix this problem?

StarGeek

Quote from: BrooksR on May 11, 2025, 02:20:19 PMWill adding -charset exif=utf8 to the command line fix this problem?

That will only affect reading/writing EXIF data, not filenames.

You might try -charset filename=utf8 as mentioned in FAQ #18. But you would have to change the code page as mentioned in that FAQ.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype