I've built a Website that uses a MySQL database and it works correctly on my Localhost using xamp. But, when I copy the exact files(including the Database) using Filezilla on the Web Server, the files that are named with an accent, in my case the file named Caffè.jpg
can't be found for some reason.
Basically, the database contains the name of the files so if I have a record called Juices
inside the database, then PHP is going to build the website and it's going to take the file named Juices.jpg
from the storage. Even on the Web Server, all the other files work great, but only the words with an accent are not working correctly. I get this error on the Web Server:
GET http://www.website.com/STRUCTURE/IMAGES/Caff%EF%BF%BD.jpg 404 (Not Found)
I know that the error might come from the fact that the Database on the Web Server uses a different encoding than on Localhost but I don't think that's the cause. Take a look at this image:
To get the images on the page, I wrote this line: <img src=\"./STRUCTURE/IMAGES/".$datas[$i]['name'].".jpg\" class=\"card_image\">
As you can see I made sure to use the same encoding on both Databases and in the index.php
file I even added the line <meta charset="utf-8"/>
. I tried all the solution I could think of and found online but with no result. In case it might be useful, I use Aruba.it
for my Web Server. In case you need more details I can easily modify the post. Thank You in advance!