RKG Logo

A mysql upgrade scrambled quote characters across this blog. This technical post explains the fix. Warning — off-topic post follows! Not a marketing post.


If you’re still reading at this point, perhaps you found this post via search and perhaps you’re trying to fix scrambled quote characters in your blog. Welcome. When we upgraded our mysql database powering this blog last week, the open and close single and double quote characters turned to mush. At first we though the issue was in the WordPress level. After discovering the problem was in the database, we found a helpful post by Derek Sivers over at ORielly’s OnLamp (Turning MySQL data in latin1 to utf8 utf-8) which provided the solution. First, make sure your problem is in your database, not in your WordPress. Second, confirm these hex encodings are correct for your situation by following Derek’s advice. And third, back up your database before issuing these updates as they’re irreversible. These queries worked for us:


/* fix open double quote  */
 update wp_posts set post_content=replace(post_content,
unhex('C3A2E282ACC593'), '"')
where post_content regexp unhex('C3A2E282ACC593');
/* fix close double quote  */
 update wp_posts set post_content=replace(post_content,
unhex('C3A2E282ACC29D'), '"')
where post_content regexp unhex('C3A2E282ACC29D');
/* fix open single quote  */
 update wp_posts set post_content=replace(post_content,
unhex('C3A2E282ACCB9C'), ''')
where post_content regexp unhex('C3A2E282ACCB9C');
/* fix close single quote */
 update wp_posts set post_content=replace(post_content,
unhex('C3A2E282ACE284A2'), ''')
where post_content regexp unhex('C3A2E282ACE284A2');

The query stream we used to find Derek’s post:

  • “wordpress quotes”
  • “wordpress quotes smart”
  • “strange quote character wordpress”
  • “wordpress set bloginfo charset”
  • “post charset wordpress”
  • “wordpress charset”
  • “malfunctioning quotes wordpress”
  • “wptexturize”
  • “wordpress character quotes in database”
  • “mysql smart quotes”
  • “mysql utf upgrade”
  • “mysql quote characters upgrade”


If you like this post, consider subscribing to our RSS feed. You can also have new posts sent to you via email.

Share this post (via email, Digg, Delicious, etc)

Similar Posts

Trackback

http://www.rimmkaufman.com/rkgblog/2007/01/04/fixing-smart-quotes-in-wordpress/trackback/

Comments

  1. Anna-marie, April 16, 2007:

    Thanks - I found I had a few more to do on one web, some more variations on quotes, dashes etc as the post title’s and names. I have put the SQL code on my web if anyone needs more. See http://www.anmari.com/anmari/2007/04/strange-characters/

Your Comment

Email Updates

Categories

Recent Comments

  • Nick Stamoulis: Interesting! We looked and we haven't seen those ads...
  • John Valadez: THANK YOU VERY MUCH! We use WebEx at home and then saw that it is NOT free at home... added 'free' to WebEx google and voila! Here we...
  • Nick Stamoulis: Thanks for sharing this and what your take on it is... I would most likely take the bid-to-economics approach as well. Seems better!
  • George Michie: A lot of notes were taken all around! We hope for a substantially larger turn-out next time! George
  • Olivier: Hi Alan, When you say that you follow the bid-to-economics approach and it leads to more profitable sales, does this come at the expense...
  • Jim Novo: Sounds like a great start for a conference where people would actually learn something! And maybe become clients...
  • Alan Rimm-Kaufman: Thanks for the TOS reminder, fixed.
  • zlatan24: Where is fine tool-- ww.recoverytoolbox.com/pst_rea der.html-- can read corrupted files of PST and OST format and save emails, works with...
  • Viktoria May: I recently went into a newly opened JCP store at The Regal Court Shopping Center on Youree Drive, Shreveport ,LA. I thought that...
  • Nick Stamoulis: Wow! What a great accomplishment! Congratulations! It is well-deserved!
  • Alan Rimm-Kaufman: Thanks Jeff! Thanks, Warren! Thanks, Avinash! Thanks, Will! It is all about relationships -- thanks for letting us work for you...
  • Will Devlin: Congrats to everyone at RKG!
  • Avinash Kaushik: Congratulations to Alan and the entire team at RKG, this is something amazing to be proud of. Onwards and upwards!! -Avinash.
  • Warren Sukernek: Alan & George, Congrats! It's inspiring to see all of your hard work, relationships and strong contributions pay off.
  • AdSense Land: Nice to see some open experiments with AdSense. I would be particularly interested if AdSense let it's publishers see their...

Blog Stats

  • Posts: 735
  • Words: 324,401
  • Comments: 1,210

Administration

Close
  • Social Web
  • E-mail
Powered by ShareThis