UnitedForums - UK Web Hosting Forum UnitedHosting Community Hosting Forums
Network and Server StatusCustomer SupportUK Web Hosting
UnitedHostingUnitedHosting Sitemap UK Hosting ForumUK Web HostingWeb Hosting ForumsUK Reseller HostingWeb Host CommunityUK Managed Dedicated ServersHosting Help and SupportUK Domain Name Registration

Go Back   UnitedForums.co.uk > UnitedHosting Community > Webmaster Discussion

Reply
 
Thread Tools Rate Thread Display Modes
Old 20th March 2008, 05:21 PM   #1 (permalink)
CVW
Registered User
 
Join Date: Mar 2008
Posts: 14
Character Encoding in Wordpress db

Hi all,

The next installment in "My first major migration":

Following the mysqldump woes from a previous thread, which I failed to sort out on my own, I am now in the realms of character encoding issues. The text of the posts are littered with all kind of weird stuff.

The story so far. Having downgraded a Wordpress database to MySql4 and got it restored to my UH reseller server I have discovered a fair number of character encoding issues with special chars. There is enough of them to stop me from continuing without sorting this one out.

Reading on the net, I find out that this is common problem with legacy WP databases, most of the text fields are latin_1. I have read up on the subject and found a few plugins that clean up the data on output but I think that the problem would be better solved before export from the old server.

Looking at PHPmyadmin, the old db and tables are a weird mixture of latin1 and utf8 and I am wondering the best way to proceed. I have currently backed up the orginal database with the previous setting and wonder what I need to do to make a successful collation change before downgrading from Mysql5 to 4.

Thanks for your time and assistance. Who knew that migrations were so complicated once you left straight up html behind? Me and shell access are having an seriously on/off relationship at the moment.

Rob

Ps Simon noted that as a reseller, I will face many issues like this in the future. Luckily for me - most of the sites I run belong to me.
CVW is offline   Reply With Quote
Old 20th March 2008, 08:14 PM   #2 (permalink)
Simon
Dedicated to life!
 
Simon's Avatar
 
Join Date: Jul 2005
Location: 3638'4.48"N - 442'18.52"W
Posts: 2,058
Send a message via MSN to Simon Send a message via Yahoo to Simon Send a message via Skype™ to Simon
Can you show an example of the characters that are being shown.. It may help to work out what the problem is,

One thing you could check is that both pld and new servers are outputing the same charset headers. I have this problem between a local dev server and the live UH servers.
I use a FireFox plugin to check headers, but you could also use one of the many free online tools you can find by searching "header checker" in google.

Best of luck!
__________________
Freelance PHP Programming
__________________
Simon is offline   Reply With Quote
Old 20th March 2008, 08:44 PM   #3 (permalink)
CVW
Registered User
 
Join Date: Mar 2008
Posts: 14
I will try to check the header responses when my old site starts loading again (down this evening again- guess why I am moving hosts?).

The kind of text I am getting:

DMX512, to all the other equipment. The poor lighting technician detailed to look after the lighting control is called a ₓBoard OP₝. This is sometimes correctly mistyped as ₓBored Op₝, referring to the tedious pressing of the ₓGo₝ button between snoozes during theatre shows. These Ops were replaced by a magical and expensive entity known as the Moving Light Operator, who spent most of the fit-up tapping buttons and muttering about ₓfixture personalities₝

When I run a special Wordpress UTF8 clean-up plug-in it sorts most of it out and just leaves random , in spaces around the text. A lot of these problems occur in places where special characters are bult not always.

When the old site is up a running again, I will back up and try running another plug-in I have found which is supposed to sort our the collation of the db for good. I can then have another go at exporting it.

I understand that there has been problems in the way that previous versions have created tables in latin-1 and utf8 combinations. This has now been sorted but the old databases are still a bit of a mess.

The other thing that I think is a problem is that, looking at the texts of original posts in the db, Wordpress does not seem to automatically escape special characters. Something I didn't know.

At the moment the whole database is utf8, tables are a mixture of utf8/latin and the fields are also mixed.
CVW is offline   Reply With Quote
Old 20th March 2008, 09:16 PM   #4 (permalink)
MrBen
Munky!
 
MrBen's Avatar
 
Join Date: Sep 2003
Location: nr Woking, England
Posts: 2,589
I think Vger had issues like this when transferring a DB. There was a thread in the Web Dev forum I think. Probably quite a while ago now.

Maybe try searching for threads started by her...

Ben
__________________
Veterinary Practice Management System by SoftFooding
Internet Data Usage Calculator: Estimate your monthly bandwidth usage for your Internet connection.
MrBen is offline   Reply With Quote
Old 21st March 2008, 01:10 AM   #5 (permalink)
Vger
Senior Member
 
Join Date: Sep 2003
Location: United Kingdom
Posts: 2,807
It's normally resolved by running the database in via phpMyAdmin but selecting Latin 1 instead of the default utf8.

I think that the problem I had before was compounded by the fact that I needed to edit the databases offline and I was using PS Pad, which uses utf8 page encoding. Opening in Text Pad resolved that problem.

Vger
__________________
Working with computers is a bit like getting old - the longer you're around the more wrinkles you find!

Last edited by Vger : 21st March 2008 at 01:13 AM.
Vger is offline   Reply With Quote
Old 27th March 2008, 05:30 PM   #6 (permalink)
CVW
Registered User
 
Join Date: Mar 2008
Posts: 14
Thanks for the help.

I have not solved the problem but I think I know what it might be. As the strange characters are appearing in only the text content of the Wordpress posts, I assume the dreaded Wordpress Visual Editor has a hand in it somewhere.

All other text fields are fine after the export.

Unfortunately, the solution I have come up with is copying and pasting the data from the old MySQL5 db to the new MySQL4 in the fields with the faults. A bit time consuming, especially as the old database server is running slow (the reason I have ditched it!).

I am doing this via phpmyadmin because I don't know of an easy offline way to do it.

Any suggestions appreciated.

Thanks

Rob
CVW is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


All times are GMT. The time now is 07:43 AM.

UK Web Hosting  |  UK Reseller Hosting  |  UK Dedicated Servers UnitedHosting  |  UnitedSupport  |  UnitedForums  |  SEO by vBSEO 3.0.0
Copyright 1998-2008 United Communications Limited. All Rights Reserved. Registered in England and Wales 3651923 - VAT Reg No. 737662309