Strange characters on all pages (over 1000 pages) after 1.6 upgrade!

Help with getting the CMS CORE package up and running. This does not include 3rd party modules, PHP scripts, anything downloaded via module manager or from any external source.
kurtf
Forum Members
Forum Members
Posts: 16
Joined: Wed Mar 19, 2008 6:05 pm

Strange characters on all pages (over 1000 pages) after 1.6 upgrade!

Post by kurtf »

I have some non-standard or strange characters appearing on all our pages of the CMS (over 1000) after doing an upgrade from 1.51 to 1.6.  I haven't seen a thread that quite matches this dilemma but figure it has something to do with UTF-8 character encoding.  Here is an example of the characters on the pages:

’

I cut and pasted the above from one of the pages which should be an apostrophe and instead is those characters.  I can't go back and manually edit each page, so how do I get TinyMCE to change all of our pages back to normal?  I've uninstalled and re-installed it multiple times through the Module manager and it hasn't changed anything.  It shows version 2.5 as being installed.

This is a huge problem for us, so any help/suggestions are appreciated!
alby

Re: Strange characters on all pages (over 1000 pages) after 1.6 upgrade!

Post by alby »

kurtf wrote: I have some non-standard or strange characters appearing on all our pages of the CMS (over 1000) after doing an upgrade from 1.51 to 1.6.  I haven't seen a thread that quite matches this dilemma but figure it has something to do with UTF-8 character encoding.  Here is an example of the characters on the pages:

’
Very strange on upgrade ....
Have you switched some param in config.php?
Look for $config['set_names'] = true; and switch to false

Alby
kurtf
Forum Members
Forum Members
Posts: 16
Joined: Wed Mar 19, 2008 6:05 pm

Re: Strange characters on all pages (over 1000 pages) after 1.6 upgrade!

Post by kurtf »

Thanks for the quick reply.  That variable was set for true and I changed it to false, but is there a way to get it to take all those characters out of the pages now that they have all been changed?
jmcgin51
Power Poster
Power Poster
Posts: 1899
Joined: Mon Jun 12, 2006 9:02 pm

Re: Strange characters on all pages (over 1000 pages) after 1.6 upgrade!

Post by jmcgin51 »

Kurt,

I had a very similar situation on 2 upgraded sites, except there were injected  characters sprinkled throughout the site.  Not changed from other characters, but new characters added in.  I could not find them via a database text search, using the HTML code (Â) or the actual rendered character (Â), so I had to manually find and replace them in all my pages.  Luckily for me the sites are fairly small.  I have a couple of other sites that I'm reluctant to upgrade because they have a large number of News items which will all need checking.

Can't help you with a fix, but at least you know you're not alone.
kurtf
Forum Members
Forum Members
Posts: 16
Joined: Wed Mar 19, 2008 6:05 pm

Re: Strange characters on all pages (over 1000 pages) after 1.6 upgrade!

Post by kurtf »

We have that same  character sprinkled throughout in many cases.  That character has replaced the non-breaking space   and inside the HTML code, this is what it now shows:

 

We're going to try and write a script that searches for all of that and replaces it, but we don't want to screw up the database, so here's hoping it all goes smoothly ;-)
mfal55
Forum Members
Forum Members
Posts: 131
Joined: Fri Jan 09, 2009 10:00 pm

Re: Strange characters on all pages (over 1000 pages) after 1.6 upgrade!

Post by mfal55 »

Hi Kurtf -
Funny you should post this - I've been dealing with the same issue as well.  I've been using phpmyadmin to search for each item and doing a replace by using:

Code: Select all

update <table_name>
set <field> = replace(<field>,'’','\'');
The unfortunate thing is that it's riddled in many tables with field names that are all labeled differently.  I wish there was a way to do a find/replace for every table and every field in the database - I just haven't found it yet if it is possible.

I hope all goes well with the script.  I would be interested in donating to it if it works! 

Good luck!
kurtf
Forum Members
Forum Members
Posts: 16
Joined: Wed Mar 19, 2008 6:05 pm

Re: Strange characters on all pages (over 1000 pages) after 1.6 upgrade!

Post by kurtf »

We're now able to make the change so it's correct in the database using the script, but the page is still printing out the wrong code.  Anyone have any ideas?
kurtf
Forum Members
Forum Members
Posts: 16
Joined: Wed Mar 19, 2008 6:05 pm

Re: Strange characters on all pages (over 1000 pages) after 1.6 upgrade!

Post by kurtf »

Clearing the site-cache did it.  We'll be posting the script shortly for those of you who have also run into this problem.
Golf Gti

Re: Strange characters on all pages (over 1000 pages) after 1.6 upgrade!

Post by Golf Gti »

Nice! I am going through this same problem! I am a database rookie so this is really annoying.
User avatar
kenton
New Member
New Member
Posts: 3
Joined: Tue Aug 26, 2008 2:31 pm

Re: Strange characters on all pages (over 1000 pages) after 1.6 upgrade!

Post by kenton »

hey everyone,

i've got a working script to fix these characters. mfal55 was right. there are multiple tables that need to be edited. i'm going through and making sure i get all of the default tables (only module is the news module). i'll update this later this afternoon when the script is done.

*** update ***

here's the script for repairing these weird characters. it replaces the weird stuff with what used to be there in numeric form. so instead of   it's &#160; if you use global content blocks for your footer, you will have to replace the © symbol.

http://kg-assets.com/utf-fix.php.zip

the only thing you should modify is whether or not to include the news module. if you want to exclude it, set $news to false in the top of the file. upload it to the same directory as config.php and head to yoursite.com/utf-fix.php

after you've run the script and gotten the okay message. empty your site cache (admin > site admin > advanced setup > clear cache)

that's it. again this worked for us locally and on our live site, but use at your own risk. make sure to backup your database before using it.
Last edited by kenton on Wed Jul 15, 2009 7:52 pm, edited 1 time in total.
Pierre M.

Re: Strange characters on all pages (over 1000 pages) after 1.6 upgrade!

Post by Pierre M. »

kurtf wrote: We'll be posting the script shortly for those of you who have also run into this problem.
Thanks in advance. This makes a script contest.

Pierre M.
User avatar
kenton
New Member
New Member
Posts: 3
Joined: Tue Aug 26, 2008 2:31 pm

Re: Strange characters on all pages (over 1000 pages) after 1.6 upgrade!

Post by kenton »

Pierre M. wrote: Thanks in advance. This makes a script contest.

Pierre M.
i work with kurtf  ;)
mfal55
Forum Members
Forum Members
Posts: 131
Joined: Fri Jan 09, 2009 10:00 pm

Re: Strange characters on all pages (over 1000 pages) after 1.6 upgrade!

Post by mfal55 »

Hi! Thank you so so much for this!  You guys are brilliant!! This has been incredibly helpful.  A couple of questions:

I see the script only handles the issue of  and â, but my site is riddled with many other characters, for example: ’, �, …, –, “, â€, ‘.  Additionally, they appear in more modules than the regular content and news modules (calendar, cguserdirectory, etc).

Can this script be easily modified to handle those other characters and be replaced across the other modules?  Unfortunately, I am not a developer, but can copy/paste/modify with some direction.

Thanks again for everyone's help on this! 
User avatar
kenton
New Member
New Member
Posts: 3
Joined: Tue Aug 26, 2008 2:31 pm

Re: Strange characters on all pages (over 1000 pages) after 1.6 upgrade!

Post by kenton »

if you can give me all of the modules that have the weird characters... and what needs to replace the characters, i'll update the script for you.
mfal55
Forum Members
Forum Members
Posts: 131
Joined: Fri Jan 09, 2009 10:00 pm

Re: Strange characters on all pages (over 1000 pages) after 1.6 upgrade!

Post by mfal55 »

Oh you are wonderful!  I'll get right back to you - the site is so large, so I've been finding them as I go along.  I'll compile the list and post back.

Thanks so much!
Locked

Return to “[locked] Installation, Setup and Upgrade”