0

Possible Duplicate:
UTF-8 all the way through

A strange problem here that I'm struggling to solve.

I am processing some CSV files with PHP and inserting the data in to MySQL. The data is made up of about 10 different European languages and some values are not appearing correctly in the database. The strange thing is that it's only some characters.

For example, in the database I see the following:

ö?eden

ba?lang?ç

You can see that some of the UTF-8 chars are correct and some are not.

I have checked the following:

  • Database charset and collation is utf8 / utf8_general_ci
  • Table charset and collation is utf8 / utf8_general_ci
  • PHP file is UTF-8
  • Db connector in PHP has charset set to UTF-8 (set names etc)
  • Source data is UTF-8
  • At the point of insertion to the database (in PHP code) echoing out the data displays correctly, the hex value looks good too.

I'm not sure what else I can do to fix the problem. If the issue was any of the above then surely the characters that are displaying correctly wouldn't work either?

Thanks for any insights.

Community
  • 1
  • 1
chrismacp
  • 3,834
  • 1
  • 30
  • 37
  • 2
    Is the collation and charset for the individual field also utf8? – Mike Brant Nov 29 '12 at 20:35
  • [Handling Unicode Front To Back In A Web App](http://kunststube.net/frontback/) – deceze Nov 29 '12 at 20:42
  • Thanks you Mike Brant! Man I've spent hours scanning my setting and other posts. I wasn't aware of setting the collation for individual fields themselves! You would have thought setting the database and table collations would have been enough! Problem solved if you want the points then submit you suggestion as an answer so I can mark it as the correct one. I dont understand why half of the characters worked though? – chrismacp Nov 29 '12 at 20:48

0 Answers0