Short Detour with the Testing New WordPress Series – Database Issue

After finishing yesterday’s article, I noticed I had a problem with the newly copied local blog: Funny characters showing up in my posts!

In IE7, they’re little empty squares:

Funny Symbols in IE7

In Firefox they’re black diamonds with question marks:Funny Symbols in Firefox

I checked the live MySql version against the one that came with XAMPP. While not identical, they’re close. Local is 5.0.45 and the live server is 5.0.24a. Checked character sets and don’t see any differences either. Both are at UTF-8 Unicode.

Then I recalled something…

See, I learned to type on a typewriter (back when dinosaurs roamed the earth if you listen to my kids) and the notion of two spaces after every period is deeply ingrained. It seems that causes odd stuff to be stored in the database.

That seems to be part of the cause (it doesn’t explain all the issues), but how about a fix?

I took a quick peak at my original backup file, using Notepad++ and after a brief search found the little critters lurking in all my posts.

Funny symbols in the database backup

I noticed that the file encoding is ANSI, so I changed it to UTF-8 instead.

Changing encoding in Notepad++

Oh ho! Funny symbols disappeared in Notepad++!

I saved the file and then re-imported it (see Part 2 of the Testing New WordPress versions series for a refresher).

… Nope, that wasn’t the answer.  Still funny characters all over the place when viewing posts.

I’ve now spent an hour goofing around with different search/replace and encoding combinations and have yet to manage any sort of real improvement. I’ve never run into this before!

Is this a show-stopper?  Nah — but definitely an annoyance!  Guess I have a bit of a research project ahead of me. A glance at WordPress Support shows that a common fix is to remove some lines from the wp-config.php file.  Unfortunately, I don’t have those lines.

About Chris

I consider myself a jack-of-all-trades. Which means I know a little about a lot... or think I do, at any rate. Check my "About Me" page for more info.
Tagged , , , , . Bookmark the permalink.