WordPress.org

Forums

Corrupt database - many of these characters--> Â (9 posts)

  1. singing
    Member
    Posted 7 years ago #

    I find accented A characters (like this--> Â ) scattered in my WP posts after upgrade from 2.1.2 to 2.5. They seem to be at end of words as if extra space characters. When I fall back to 2.1.2 and re-import my backup 2.1.2 database file they are not visible in my posts. but when I re-converting the database with /wp-admin/upgrade.php I see them again in the posts. However using phpMyAdmin to read the raw file I see the bad characters in both the the converted and unconverted files. I'v moved thing back and forth so many times that I'm not sure that I didn't corrupt the backup by an impropper setting in the phpMyAdmin export window. I'm using phpMyAdmin version 2.8.0.1 which newer and has a few more tick boxes and entry/selection fields than in the WP backup instructions, but I did tick the boxes recommended, but didn't mess with the other defaults that I did not understand.

  2. sabinou
    Member
    Posted 7 years ago #

    Maybe for some unknown reason the locale of your database changed and foreign language characters appeared out of nowhere. I know that is irrational, but after all, your problem appeared irrationally. Go figure.

    Since you were careful and wise, and made a backup, you can "toy" with your database, now.

    My suggestion is : open your .sql backup in a text editor, and do a search-and-replace of your weird character with "nothing".
    Save it under a different name, and replace your current online DB with that one, and see if it works ;)

    Rather than notepad, I'd recommend notepad++, it adds semantic coloration, understands unix line breaks (i.e. no more one-line impossible to understand css or php source files), and has more powerful functions when you want to to coding or searching, replacing.

    Good luck...

  3. reybeez
    Member
    Posted 7 years ago #

    For future reference, don't copy paste from Word. It uses smart quotes, elipses, em-dashes...all things that wind up doing some pretty wacky junk when you move databases.

  4. Leegrears
    Member
    Posted 6 years ago #

    This happens becuase in the new wp-config.php file it has a line that looks like this

    define('DB_CHARSET', 'utf8');

    This can be changed to UTF-8 or simply removed. Worked for me. Make sure the same charset is saved in the admin and in your webpage head.

    Need help, get in touch http://webvolorem.com

  5. whooami
    Member
    Posted 6 years ago #

    define('DB_CHARSET', 'utf8');

    removing that will do nothing to affect chars that are converted during an import or upgrade that started as word related issues, such as reybeez suggests.

  6. 4k
    Member
    Posted 6 years ago #

    When my host upgraded php that happened on one of my blogs and I solved it by adding // in front of define('DB_CHARSET', 'utf8');

    so

    //define('DB_CHARSET', 'utf8');

    worth a shot

  7. whooami
    Member
    Posted 6 years ago #

    thats the functional equiv of removing the line :)

    it works for some of these issues, but not all of them.

  8. dhblog
    Member
    Posted 6 years ago #

    I had the same issue after upgrading from 2.5 to 2.6.3
    I took Leergrears' advice and deleted:

    define('DB_CHARSET', 'utf8');

    from wp-config.php.

    Worked perfectly. Thanks!

  9. hoppy44
    Member
    Posted 6 years ago #

    Thanks so much for the assistance here. Same issue going to WP 2.7. I commented it out and it instantly corrected everything, saving me the time of search and replace on 36 different (long) blog entries.

Topic Closed

This topic has been closed to new replies.

About this Topic