0

First of all, sorry for my English :p

I want to upload an excel file (.xlsx) with names through my web. I upload and save the data correctly in my database, but when I show that data on my website the names like João or André are shown like: Jo�o and Andr�.

The collation in that table is utf_8_general_ci, and that names are shown like Joã£o and Andrã©.

According to the function mb_detect_encoding(), that names in the excel file are utf-8.

I tried to convert the names to utf-8 with utf8_encode() and mb_convert_encoding(), I tried to save the excel file like utf-8, I tried to save the excel file like ISO-8859-15, I tried to paste the names to notepad and save them like utf-8 and copy to my excel...I have tried many things and none has worked for me!.

I can't covert the excel file to .csv because it has to be an Excel Workbook, I'm saying it because I read that it could be a solution.

I have run out of ideas...

UPDATE: It's very strange because in localhost doesn't work, but when I upload it to the server the characters are displayed correctly

Nebur81
  • 29
  • 1
  • 9
  • 1
    Possible duplicate of [UTF-8 all the way through](https://stackoverflow.com/questions/279170/utf-8-all-the-way-through) – miken32 Mar 19 '18 at 20:15

1 Answers1

0

If mb_detect_encoding() is TRUE for 'UTF-8' then you only have to specify the character encoding in your HTML meta tag. Then your browser knows how to decode and display the data.

<meta charset="UTF-8">

https://www.w3schools.com/html/html_charset.asp

MichaEL
  • 84
  • 4
  • I had already specified the character encoding. it's very strange because in localhost doesn't work, but when I upload it to the server the characters are displayed correctly – Nebur81 Mar 26 '18 at 14:00