Convert filenames to use only latin characters
-
04-12-2019 - |
Domanda
I have a ton of filenames in Russian (and some Slovenian & Greek). To play them in my car the song titles must use only Western European characters.
Is there a program that can do this file renaming?
If not, is there a list of what letter(s) to use for each Cyrillic & Greek letter?
thanks - dave
Soluzione
David,
I'm not aware of any program that will do it automatically (although given the information below, I bet you could get a computer geek friend to do it for you in exchange for a pizza.) Actually, the program really wouldn't be that hard to write in Perl.
In any case, here is some information that would help you choose which letters to use for each Cyrillic, Slovene, and Greek letter.
http://en.wikipedia.org/wiki/Romanization_of_Russian
http://en.wikipedia.org/wiki/Slovene_alphabet
http://en.wikipedia.org/wiki/Romanization_of_Greek
Hope that helps a little bit!
Altri suggerimenti
This is a Russian transliteration table:
If you have python installed, you can use this script:
It seems to do a pretty good job and also you can change it to your needs. It did not work out of the box for me, I had to remove the encode
call from following two lines (line numbers given in front):
117 print fpath.encode('utf-8')
136 print 'Copying %s to %s' % (fpath.encode('utf-8'), new_fpath)
i.e. change to:
117 print fpath
136 print 'Copying %s to %s' % (fpath, new_fpath)
but then worked fine, example (assuming you put the script from the above with the changes given to the file in the same folder called transliterate.py
and then chmod u+x transliterate.py
to make it executable):
$ mkdir a
$ touch a/сказать
$ ./transliterate.py a
a/сказать
Copying a/сказать to a/skazat'
Hope this helps.
Try a free programme called ReNamer by den4b, worked great for me.
Here is the improved python script, which renames file to latin and removes old ones, plus it replaces all spaces with underscore character.
I've made a shell script for this purpose.
It is using uconv
from the icu-devtools
package to perform the transliteration.
I also made simple shell script that does not depend on any 3rd party package than sed
, but this should be installed by default on most of Linux distros.
By default it transliterate only Cyrillic, but you can easily expand it with Greek characters using above provided link to Wikipedia article - http://en.wikipedia.org/wiki/Romanization_of_Greek