anatak Posted November 28, 2007 Share Posted November 28, 2007 I have a database I use for development and now I want to update the online database. When I export the offline database and then import it into another database the utf-8 text is messed up. here is what I did for testing. create an empty database test with charset utf8 connection collation utf8_unicode_ci database collation utf8_unicode_ci after that I export the development database using export SQL format sql compatibility mode NONE export structure -add auto_increment -enclose table and field names with backquotes export data with -complete inserts -extended inserts max length 50000 use hexadecimal for binary fields export type INSERT save as file import the file in the test database and all the utf-8 data is messed up. I tried with compressed file but that does not help any help would be greatly appreciated. anatak Quote Link to comment https://forums.phpfreaks.com/topic/79217-how-to-export-utf-8-data/ Share on other sites More sharing options...
toplay Posted November 29, 2007 Share Posted November 29, 2007 Also issue: SET NAMES 'utf8' Don't try and edit file after it's saved (in case your editor is not really utf-8 compatible). Search this forum because there's lots of posts on utf-8. Quote Link to comment https://forums.phpfreaks.com/topic/79217-how-to-export-utf-8-data/#findComment-401808 Share on other sites More sharing options...
anatak Posted November 29, 2007 Author Share Posted November 29, 2007 I found the reason why my db behaved like it did. the database I used for developing was with database collation utf8 (beta) the copy I made is with collation latin (info) the export of the copy I made was loaded in an utf database. (copy info) If I change the collation of the database "copy info" from utf to latin the data is displayed correctly. the thing that still puzzles me is that the tables are all on collation utf. What does the collation of the database defines ? thank you for the set names suggestion. that got me on the right track. anatak Quote Link to comment https://forums.phpfreaks.com/topic/79217-how-to-export-utf-8-data/#findComment-402491 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.