WordPress.org

Ready to get started?Download WordPress

Forums

WP 2.2 Upgrade Messed Up Characters (23 posts)

  1. Firas
    Member
    Posted 6 years ago #

    So I just upgraded to 2.2 and for some reason many of my characters that are non-ASCII (smart quotes, acute-accented characters etc.) are all messed up after the db upgrade. Check it out here:

    http://firasd.org/weblog/2007/05/06/hedge-hatred-hysterical

    It turned:
    "à la mode. Condé Nast"
    to:
    "à la mode. Condé Nast"

    It's not just a display encoding problem—they're like that inside the db itself.

    Has anybody else experienced this? I imagine it'd be a nightmarish occurrence for anyone with a non-English blog! Any idea what can be done about it?

  2. MichaelH
    Member
    Posted 6 years ago #

  3. Firas
    Member
    Posted 6 years ago #

    Yeah, rather strange… I didn't change the default constants in there (DB_CHARSET was set to utf8 and DB_COLLATE was empty). I'm just not sure to what extent they're involved in the db upgrade process… and it looks irreversible because the characters in the actual tables are messed up. May have been a combination of factors specific to my installation.

    I suppose at this point I'm mostly wondering if there's something specific to mysql that can 'fix' the characters (I tried copying the posts table and changing the copy's collation of the post_content row from latin1_swedish_ci to utf8_unicode_ci; no dice.)

    So yeah, I suspect I should despair at this point. All fairly annoying. You'd think upgrading WP wouldn't be like getting axed in the forehead. (Et tu, WordPresse?)

  4. Dgold
    Member
    Posted 6 years ago #

    I'm having a similar character encoding problem on 1 of my sites, the weird thing is, I didn't upgrade that site yet. It's still 2.0.5 (I upgraded my other site to 2.2 and it does not have a character problem as far as I can tell).

    What I did do, is move servers, to a server that has the newer PHP and MySQL versions needed for 2.1+. And that's when the weird characters got in my database, I think. Or I could be totally wrong but I noticed it right after that, got a Comment about it.

  5. Firas
    Member
    Posted 6 years ago #

    Did you export or import your DB via phpmyadmin? That could have introduced the issue.

  6. Dgold
    Member
    Posted 6 years ago #

    Yeah, I did both Export from phpAdmin (older version), Import into phpAdmin (newer version). I remember I check-marked some option for the Import like MySQL3 compatibility.

    Should I have done it different?

    It's probably too late to go back now, I mean, I could try importing again with an older Backup from the previous server (and I would have to repost the newer posts) -- probably my WP-Database Backup file. I don't have access to the old phpAdmin anymore so I can't export again if that's where my error was.

    By the way I found some apostrophes converted to questionmarks in my main site as well (the site that I have upgraded). :(

  7. mgiraldo
    Member
    Posted 6 years ago #

    i got this also... i just upgraded from 2.1.3 to 2.2

    i did not backup/export/import my database (maybe i should have)

    i just downloaded, deleted files, uncompressed and ran upgrade.php... all my spanish-language chars got messed up (and other chars like em dash)

    i have just spent about three hours re-typing every single spanish character in every post (good thing i did not have that much posts written)

  8. MichaelH
    Member
    Posted 6 years ago #

    If you are doing an upgrade, you SHOULD NOT have DB_CHARSET and DB_COLLATE in your wp-config.php file. [1]

    Resources:
    Editing wp-config.php
    Converting_Database_Character_Sets

    [1] if you previously (before 2.2) made changes to the SETNAMES and COLLATION in wp-db.php then you can use the wp-config.php file to make those settings without having to modify wp-db.php

  9. purplemotes
    Member
    Posted 6 years ago #

    The same thing happened to me when I upgraded from 2.1.3 to 2.2. All my upgrades have been via fantastico. Is there any simple way to get this problem corrected? Should I try to roll back to 2.1.3 and wait for a future upgrade?

  10. Dgold
    Member
    Posted 6 years ago #

    I think that if you already went Upgrade > Made new posts > Then noticed the problem....

    it would be very hard to go-back...

    I think you'd have to get the Old database (before the upgrade messed up the characters), and reinstall that, and then re-make your subsequent posts.

    I doubt if rolling-back to a previous WP would repair the database. I could be wrong.

    For me personally 1 week or more passed before I saw the problems, now I don't know what to do. Probably either change the errors by hand, or just live with an unreadable archives, or *maybe* going to try some kind of Find-Replace All in phpMyAdmin. Actually I think there is a WP plugin for "Replace all" in your database, I'm going to look for that.

  11. Firas
    Member
    Posted 6 years ago #

    I just got an email from someone who reports having experienced this problem as well. The sad thing is that there is absolutely no way to go back that I can think of, your data is truly screwed. Anyway, googling around takes me to this post from April 06 which reports that doing search & replace should work.

  12. animator
    Member
    Posted 6 years ago #

    See this it may help.

  13. ganzua
    Member
    Posted 6 years ago #

    I have the same problem when uploading my database to my computer server.

    I checked the database with ultraedit and all words were ok, I don't think a Find-Replace All is a good solution.

    and by the way, I didn't manage to solve this issue.

  14. razvanone
    Member
    Posted 6 years ago #

    Ok, so I have the same problem, after upgrading from Fantastico to WordPress 2.2.

    I even tried re-posting one article with romanian characters and after submit, the characters got messed up again.

  15. Firas
    Member
    Posted 6 years ago #

    Keep in mind that these are different issues:

    -> Characters in database are ok but not displaying correctly.
    -> Characters in database are wrong but fine after re-editing post content (which is the case with me.)
    -> Characters wrong in wp but still not fixed after re-editing via wp.

    They're symptoms of entirely different problems, with accordingly different probable solutions. Make triple-sure you know where the error is occurring:

    -> Check your database in phpmyadmin to see if the original characters within it are wrong.
    -> The other thing that could be introducing the error is WP and/or its configuration (or something else in the php layer including phpmyadmin.)
    -> Then there could be a http/html issue making the browser misunderstand the intended character mapping.

    Again, first step when you see this: make sure you know what level the error is being introduced in.

  16. maureenfrancis
    Member
    Posted 6 years ago #

    I have the character problem too. I upgraded using fantastico for my blog, http://mioaklandcounty.com

  17. moshu
    Member
    Posted 6 years ago #

  18. maureenfrancis
    Member
    Posted 6 years ago #

    I put the // in front of those two lines but it caused a different problem. Now there are different symbols where the funny characters were before. Boxes in IE and ? marks in diamonds in firefox.

  19. harknell
    Member
    Posted 6 years ago #

    The language stuff is all symptoms of the language encoding that got introduced in Mysql 4.1. What probably happened was by default MySql uses the swedish character set and when you try to convert it to any other set those weird characters appear due to that being their equivalent in the new character set. It gets worse since most people use phpmyadmin to back up their databases, but that screws things since converting the database to a file on a non-swedish system adds those characters also. The only way to really get around it from phpmyadmin is to export your database with mysql 4.0 compatibility mode checked off, this will not add the language stuff into it.

    I've had to do the cut and paste stuff before and it sucks....especially if somehow you end up putting a ' in a line that then blows up the mysql formatting and it won't load back into the server.

    I had an explosion last night that I had to fix by reverting.

  20. Firas
    Member
    Posted 6 years ago #

    Maureen, I experienced the same thing—commenting out the two lines in wp-config.php changed the weird characters in question, but didn't set them back to the actual character I'd typed in.

    Anyway, eureka—a fix! (Suggested by Eric Anderson):

    1. Convert text columns to blobs
    2. Change collation on the table
    3. Convert blobs back to text

    I tried it on a copy of my wp_posts table and it worked, though I haven't done it on all my live data yet.

    I was going to make a plugin that takes care of this issue, but not sure that I'll get around to it—figured I'd at least point out the manual way of fixing things.

    Remember to backup your database first!!

  21. MichaelH
    Member
    Posted 6 years ago #

    Member andersopt also posted a script to do a conversion:
    http://wordpress.org/support/topic/117955?replies=6

  22. afdenahy
    Member
    Posted 6 years ago #

    I had this problem. Here is my solution.

  23. seriocomic
    Member
    Posted 6 years ago #

    I spent 3 hours mucking around with importing/exporting and general SQL in phpMyAdmin with no luck.

    It took 2 seconds to delete:

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

    in wp-config.php to fix the issue.

Topic Closed

This topic has been closed to new replies.

About this Topic