Find And Replace

by Kabitzin on September 4, 2007 in Blogging Tips,Site News

So of course the UTF-8 conversion could not go off without a hitch. It seems that comments are sometimes not converted correctly, although everything else is. Normally, find and replace in MySQL databases is frowned upon, but because the gibberish is so unique (sorry to those who type entirely in gibberish), it is a prime candidate for F&R. Here are some of the queries I used:

UPDATE wp_comments SET comment_content = REPLACE (comment_content,'“','"')

UPDATE wp_comments SET comment_content = REPLACE (comment_content,'”','"')

UPDATE wp_comments SET comment_content = REPLACE (comment_content,'…','...')

UPDATE wp_comments SET comment_content = REPLACE (comment_content,'’','\'')

Note in the last one how the apostrophe has to be escaped with a backslash, or it will throw an error. A handful of comments had heavy conversion errors, and I had to cut them. My apologies, although I couldn’t read them to begin with…

Related posts:

  1. Updating Obsolete URLs in 10 Easy Steps
  2. Changes to Spoiler Tags
  3. False Positive!

This post was written by...

– who has written 1935 posts on Sea Slugs! Anime Blog.

One of the founders of Sea Slugs, I handle most of the blog admin tasks while wearing my I AM BOSS shirt. I like my action series well choreographed, and my romance series extra trashy. I also have a soft spot for puns.

{ 2 trackbacks }

{ 3 comments… read them below or add one }

Jesus159159159 September 4, 2007 at 3:26 pm

Lets just hope my gibberish doesn’t turn to moon-language gibberish again! I’ve noticed some of my other comments getting the “Axe of Despair”, but i think those are better left “circumcised” XD

(oh yea, I LOLed at the “I Barely Kotonoha” I love that type of humor!)

Reply

g30rg3_x September 4, 2007 at 4:06 pm

Hi,

First, pardon my really bad English.

Second, thanks for referring my work (and of course of give at least a little try).

Third, about the plugin problems and other related matters that you mention, is like you say my plugin/converter has issues, this problems are related to a lot of compatibilities problems between mysql 5 and 4 also there are other related circumstances that will make a failure (like having FULLTEXT indexes), for this i have being working on a new version of the converter (3.0) that will change radically the way that the real engine convert the database.

Four, about the rearrange (blogroll order change), this problem is related to the collation, you can learn about the collations and his effects here:
http://dev.mysql.com/doc/refman/4.1/en/charset-collation-effect.html
Also i have to add that my plugin doesn’t let you decide what collision to use because normally nobody will need to change the general (default collation) to another specialized but like i say in the next version this will be present so is just about to wait some little time :)

Also if you know about other issues or other features that you think the plugin needs let me know about it..

Grettings from mexico and again pardon me my really-suck-bad engliish

Reply

Kabitzin September 28, 2007 at 12:42 pm

Those who encounter UTF-8 conversion errors may also want to check out this plugin for UTF-8 Sanitizing. I have not tried the plugin myself, but it sounds simple, and promising.

Reply

Leave a Comment

Previous post:

Next post: