I use this
site to convert sequence of bytes like this:
Рабыни
into proper character sequences like this:
Рабыни
It seems that the site decodes the UTF8 sequences into their original characters. For some reason, some of my files names are corrupted and I need to convert them back to their original.
Since number of files is not less, I decided to write a perl script for this purpose. I tried this
use utf8;
$str = "Рабыни.avi";
utf8::decode($str);
binmode STDOUT, ":utf8";
print "$str\n";
as a test on one file name. When running the script, I redirect the output to a file. When I see the content of the file, I see that the content is the same as the input string and no conversion is made. This is while the output is consistent to what the site converts for sequences like this:
ангелов
I tried running the script on both Linux (Ubuntu) and Windows by using ActivePerl and both give the same result. Concentrating on Windows, what do you think to be the error of the script?
Thanks
What I have tried:
I tried to manually rename the files, but since they're lots of file, it takes time and need effort.