Special chars on filename problems with Centos and Apache
Hi all,
I have a webserver runing centos and apache. One of my client's site was hosted on Windows and I've mirrod his site using lftp. Now I have a problem with files with accented words, like "duração.jpg", "foto do café.jpg" and others. On the command line a "ll" shows the folowing: duração.jpg -> dura\347\343o.jpg foto do café.jpg -> foto\ do\ caf\351.jpg However, the pictures does not shows correctly on the browsers, and inspecting apache's error log I could find that it's trying to load "dura\xc3\xa7\xc3\xa3o.jpg" or "foto do caf\xc3\xa9.jpg". How could I rename all of these files? Would there be a .htaccess rewrite rule for that? I've searched around the web today and found about the command rename. I've tried a few commands but no success, also, I'm not that good with regular expressions. |
Hi, welcome to LQ!
You may be after something like this: http://sharealike.org/index.php/2008...iles-to-utf-8/ Of course I don't know *which* actual windows encoding may have been in use to get the Brazilian characters ... Cheers, Tink |
Tinkster
Thanks for your link, but the problem would be the file name itselft, not it's content. It seems that the real problem here is that browsers requests the files using UTF-16 (?). I've been testing out this requests and while browsers fail to retrieve the files, download tools such as GetRight can grab the files perfectly. Unfortunatelly I don't see many other solutions other than creating a script that will rename all files and replace the html contents with the new file name. This would be safer for the future, and better for the client. Also, They will have to learn with their mistake. |
|
Superb!!
Tink,
Thanks for your help! Worked like a charm! I'll keep this convmv script for my life! I owe you a beer man! :D Thanks a ton! |
If you are working in konsole, does it help changing the encoding to utf8?
I've noticed that some commands don't play nice with these filenames. Code:
ls dur*.jpg |
Quote:
place where you live ;D Cheers, Tink |
All times are GMT -5. The time now is 02:44 AM. |