Pages

Jun 29, 2011

Typical MySQL encoding problem

Don't you just HATE encodings?

Ever wanted to insert something in MySQL and were 100% sure the text/database/table/fields were in UTF-8 and by some reason the text got all scrambled up?

This usually works for me:

mysql_query("SET NAMES 'utf8'");

Hope it helps!

No comments:

Post a Comment