Changing charactersets for filenames

Started by ibex, April 27, 2024, 11:08:49 PM

Previous topic - Next topic

ibex

Running on Windows 10 in Exiftool 12.82 and I'm using  -xmp:geolocate<gpsposition to populate the location tags from the gps position of the photo.

Initially I was getting results like this in my data for some of the values:
======== d:/photohub/05_renamed/2018/2018_france/201809_Vanves/20180920_112639_IMG.jpg
State                           : ├Äle-de-France
======== d:/photohub/05_renamed/2018/2018_france/201809_Villargondran/20180923_144517_IMG.jpg
State                           : Auvergne-Rh├┤ne-Alpes
and after following FAQ 18  I got this result
======== d:/photohub/05_renamed/2018/2018_france/201809_Vanves/20180920_112639_IMG.jpg
State                           : Île-de-France
======== d:/photohub/05_renamed/2018/2018_france/201809_Villargondran/20180923_144517_IMG.jpg
State                           : Auvergne-Rhône-Alpes
but I'm not sure I should use these characters in a directory name, mainly because they're hard to enter from the keyboard but also unlikely to be thought of when searching for photos.

Is there some way to convert them to a more anglicised name for easier use in finding files in future? 

StarGeek

Yes.  I created a helper function for exactly this purpose some time ago.

Save the config file that is in this post into the same directory as exiftool. You're not going to actually use the tag in that file, but instead use the helper function that is part of it.

Your command would start like this assuming CMD.  Powershell has different quoting rules
exiftool -config StateAbbrev.config -api "filter=MyNormalize($_)" <rest of your command>

I give an example below it in this post where it shows that Québec and Yucatán have been converted to Quebec and Yucatan.
* 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).

ibex

That's awesome, Thankyou and great timing.  I just had a whole batch of renames fail with names like:
 Warning: Error creating directory for 'D:/Photohub/05_renamed/2019/2019_Switzerland/201910_Z├╝rich (Kreis 1) / Lindenhof/20191007_094533_IMG.jpg'
so I'll set this up tomorrow and see what happens.