0

I have an Excel file in which there are currency symbols. When I upload that file using PHP in my database it makes the Euro Symbol i.e '€' like '¬'. I have kept the collation for the currency symbol as utf8-general-ci.

Also when i tried echoing the value from Excel it prints as '¬' instead of '€'

Kindly help to fix this.

Darshan
  • 39
  • 1
  • 2
  • 12

1 Answers1

0

Try setting mysql_query("SET NAMES utf8"); in your php code.

Also take a look to this question How can I store the '€' symbol in MySQL using PHP?

Community
  • 1
  • 1
Athafoud
  • 2,898
  • 3
  • 40
  • 58
  • Ok, my suggestion is not to use excel file but a csv or txt file. You don't want to mess with Microsoft's encoding. Also check that your file is saved with the correct encoding options. I don't think that your problem is the database because i use the same db collation to save currencies. – Athafoud May 30 '14 at 11:33
  • How can i check the encoding of my excel file? – Darshan May 31 '14 at 05:39
  • I can not walk you through all the excel versions, a general flow goes like that Options -> advance options -> web options (encoding). Also take a look in php `mb_string` and `iconv` libraries for ways to convert a string's encoding and check if the library, you are using, for parsing excel file supports any encoding options – Athafoud May 31 '14 at 19:27