We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 686
    • 24 Posts
    Hi

    I have latin1 (iso-8859-1) text in my database that doesn’t seem to want to export in the same format. I’m using phpmyadmin to do the export, and its reporting that the db is setup with UTF8 encoding. A bit of a problem. I would use the modx manager to do a backup, but thats a separate db.

    Can anyone recommend anything?

    Thanks.
      • 6726
      • 7,075 Posts
      How did you end up with latin1 encoded text in a utf-8 database, unless you set the manager to latin1, added content with this character set into a utf-8 encoded database (bad idea) ?

      Anyway, Google is your friend :
      http://alexking.org/blog/2008/03/06/mysql-latin1-utf8-conversion

      Except your problem is reverse that of Alex King but you’ll easily figure out the process smiley
      Use any good text editor to convert your data to the proper character set before you import.


        .: COO - Commerce Guys - Community Driven Innovation :.


        MODx est l'outil id
        • 686
        • 24 Posts
        Thanks for the reply.

        We went with latin1 because there was a modx plugin that needed it and because we felt that PHP5 didn’t have good UTF8 support for date handling.

        The strange thing about our problem was that even though all the text data was in latin1, phpmyadmin was converting it to utf8. And this is great for most people because thats exactly what one would want to do I guess. But I simply wanted to move the existing tables to another MySQL installation, keeping the current encoding.

        I tried to convert the outputted SQL file using the iconv utility that other people seem to be using, but it kept giving me an "illegal characters" error. I did the same thing in my Edit Plus text editor and again got some warnings. MySQL also refused to except the converted SQL.

        The solution: I moved the tables into the same db as the modx table, and used the manager to export the tables to a file.

        In normal cases I could have probably used this method:
        http://www.hackszine.com/blog/archive/2007/05/mysql_database_migration_latin.html

        This doesn’t require you to manually convert the exported SQL file to the desired encoding. I couldn’t do this though as the destination machine was running MySQL4.0 (we’re now upgrading to 5).

        Very frustrating, but I learned quite a bit in the process at least.