upgrader Posted July 27, 2009 Share Posted July 27, 2009 Hi there, I have a database in which all the columns have collation as utf8_general_ci. Previously I was connecting to the database and inserting data without using SET names utf8, therefore a lot of the data has been inserted with the wrong encoding. The problem is all the data before using that has been stored incorrectly, and wierd characters are displayed instead. How can I convert that data into utf8? I think it must be mixed now, as I changed it to use set names utf8 so some data is correct. Quote Link to comment https://forums.phpfreaks.com/topic/167666-convert-data-to-utf8/ Share on other sites More sharing options...
aschk Posted July 28, 2009 Share Posted July 28, 2009 In a phrase, "You can't". Because the characters were trunced to 2 bytes (i'm assuming previous collation was latin_1 based), you have lost the end 2 bytes of the utf-8 character that you attempted to insert. Therefore you don't know what character the original was. Quote Link to comment https://forums.phpfreaks.com/topic/167666-convert-data-to-utf8/#findComment-884902 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.