SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Guru ripcurlksm's Avatar
    Join Date
    Aug 2004
    Location
    San Clemente, CA
    Posts
    859
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Cant export database without weird characters showing up ==

    1) My local database has weird characters () in there which should be spaces.
    2) So I do a find and replace on the entire database to remove them:
    Code:
    UPDATE report SET overview = REPLACE(overview, '', '');
    3) I check the data locally and all the 's are removed.
    4) I export the database and try to import it on my testing server online, and the characters are still in there! I try to import the same SQL file locally and the characters come back as well.

    Something is happening when I export the database to an SQL file.


    I have tried a MyISAM/UTF8 and it didnt work. I tried a MyISAM/latin and it didnt work.

    what am i doing wrong?

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    The character set is probably getting bungled at some point in your import/export process. Any chance you have access to both servers directly? mysqldump one straight into the other from the shell, or copy the actual database files?

  3. #3
    SitePoint Guru ripcurlksm's Avatar
    Join Date
    Aug 2004
    Location
    San Clemente, CA
    Posts
    859
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok I got it...

    1) I used these instructions to convert latin1 to utf8 (http://alexking.org/blog/2008/03/06/...tf8-conversion)

    2) My import helper (bigdump) needed to be adjusted to encode utf8 instead of latin

  4. #4
    SitePoint Guru ripcurlksm's Avatar
    Join Date
    Aug 2004
    Location
    San Clemente, CA
    Posts
    859
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Everything is working but this is odd:

    The MySQL data is UTF-8

    If I set the HTML charset on the page to latin, it looks fine
    If I set the HTML charset on the page to UTF-8, I get weird characters.

  5. #5
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Was the character set on the page latin when someone submitted that data from a form? Just because you tell MySQL to treat the data as UTF8 doesn't mean it was UTF8 encoded bits you put in there.

  6. #6
    SitePoint Guru ripcurlksm's Avatar
    Join Date
    Aug 2004
    Location
    San Clemente, CA
    Posts
    859
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Gotcha, whats weird is that the database is freaking out over tabbed spaces... which are empty spaces, and show up as empty spaces when you look at the data in MySQL


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •