Convert 500+ files' names from Unicode U+0600 to Text

Viewed 307

Due to compressing files t move from a server to another many times a huge number of images had their names changed.. from Text to Unicode U+0600 ... Which is Arabic BTW

Here is a sample

#U062a#U0637#U0628#U064a#U0642#U0627#U062a-#U0645#U062c#U0627#U0646#U064a#U0629-#U0644#U0644#U062a#U0644#U0648#U064a#U0646.jpg

I used this tool to convert it http://www.branah.com/unicode-converter I had to delete the "#" though .

The problem is that there are more than 500 files. probably up to 1000. And I am using WordPress, and All the files are on the server.

Is there anyway to convert them? Probably using PHP or any script.


Update 01:

I found this useful tool, since I am using CentOs: It's called convmv

Here's a link to the tool: https://www.j3e.de/linux/convmv/

It's a Perl script. And here is a list of its commands : https://www.j3e.de/linux/convmv/man/

The problem is still that I don't know where from and where to..

Does anyone have any experience with this ?


Update 02: Trying to run the Script provided by Kenosis

I first ran the script to test it:

# perl -wc perl_script.pl
perl_script.pl syntax OK

The I ran the Script without the check syntax:

# perl -w perl_script.pl
Testing: #U0627#U0644#U0623#U064a#U0628#U0627#U062f-Air-150x150.png -> lfybd-Air
-150x150.png
Testing: #U0627#U0644#U0623#U064a#U0628#U0627#U062f-Air-244x300.png -> lfybd-Air
-244x300.png
Testing: #U0627#U0644#U0623#U064a#U0628#U0627#U062f-Air-332x190.png -> lfybd-Air
-332x190.png
Testing: #U0627#U0644#U0623#U064a#U0628#U0627#U062f-Air-518x400.png -> lfybd-Air
-518x400.png
Testing: #U0627#U0644#U0623#U064a#U0628#U0627#U062f-Air.png -> lfybd-Air.png
File 'perl_script.pl' not in convertible format!
Done!

Your help is so much appreciated. thanks

2 Answers
Related