[SOLVED] Spurious characters in content after 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.
Locked
nlindq
Forum Members
Forum Members
Posts: 10
Joined: Fri Feb 01, 2008 2:11 am

[SOLVED] Spurious characters in content after upgrade

Post by nlindq »

I've recently upgraded from 1.6.10 with PostgreSQL all the way to 1.11.10 (with every major release step upgraded in between) on MySQL 5.1.73. PHP is version 5.3.3, all running on CentOS 6.x.

After the switch to MySQL (at the 1.10.3 upgrade step), spurious high-byte characters showed up on some of the content pages. The characters in question are nowhere in the dump / load scripts generated during the database transition, and if I perform direct queries on cms_content_props for the affected pages, the characters aren't present in the database either.

They do show up in the admin editors, either in GUI or non-GUI mode. Suspecting there might be a strange character encoding issue, I made sure the MySQL server uses utf8 as the default--the databases were created with utf8 encoding as per the install guidelines.

If I remove the spurious characters in the editor and apply the changes, they are accepted and the characters disappear from the presented pages as well, so if all else fails I can do a manual audit of every page and hope we don't miss anything.

It'd be awfully nice to find a cause, though. I've got three different sites worth of content all exhibiting the same spurious characters, so a general fix would be most welcome.

Any ideas?
Last edited by nlindq on Thu May 22, 2014 7:41 pm, edited 1 time in total.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Spurious characters in content after upgrade

Post by calguy1000 »

can you post the contents of your config.php (masking out the database credentials).
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
nlindq
Forum Members
Forum Members
Posts: 10
Joined: Fri Feb 01, 2008 2:11 am

Re: Spurious characters in content after upgrade

Post by nlindq »

Certainly:

Code: Select all

<?php
# CMS Made Simple Configuration File
# Documentation: /doc/CMSMS_config_reference.pdf
#
$config['dbms'] = 'mysqli';
$config['db_hostname'] = 'localhost';
$config['db_username'] = 'cms_user';
$config['db_password'] = '*****';
$config['db_name'] = 'maei_cms';
$config['db_prefix'] = 'cms_';
$config['db_port'] = 0;
$config['root_url'] = 'http://www.maei.ca';
$config['timezone'] = 'America/Edmonton';
$config['default_encoding'] = 'utf-8';
?>
User avatar
Jo Morg
Dev Team Member
Dev Team Member
Posts: 1967
Joined: Mon Jan 29, 2007 4:47 pm

Re: Spurious characters in content after upgrade

Post by Jo Morg »

Try commenting out $config['default_encoding'] = 'utf-8'; by prepending a # on the line:

Code: Select all

#$config['default_encoding'] = 'utf-8';
BTW, $config['root_url'] = 'http://www.maei.ca'; shouldn't be needed either.
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Spurious characters in content after upgrade

Post by calguy1000 »

There are two things that could be up:

a: The mysql import file contained the utf-8 characters, but did not create the tables and fields in utf-8 character sets

b: Character set encoding problem in communication between the mysql client and server. try setting $config['set_names'] = false; in the config.php.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
nlindq
Forum Members
Forum Members
Posts: 10
Joined: Fri Feb 01, 2008 2:11 am

Re: Spurious characters in content after upgrade

Post by nlindq »

calguy1000 wrote:There are two things that could be up:

a: The mysql import file contained the utf-8 characters, but did not create the tables and fields in utf-8 character sets
My process for transitioning from Postgres to MySQL involved using the usual install process to generate the database tables, followed by a "schema-only" dump/restore, so assuming the installer does the right thing, I don't think this applies.

Also:
calguy1000 wrote: b: Character set encoding problem in communication between the mysql client and server. try setting $config['set_names'] = false; in the config.php.
That worked! After setting that configuration item and clearing the site cache, pages are now loading without spurious characters. Should that be considered a solution, or a workaround for something I missed in my setup?
Locked

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