Page 1 of 1

Installation scrambled all accented chars

Posted: Wed Aug 01, 2012 5:47 pm
by saltydog
On one of my sites I have just upgraded from 1.10.3 to 1.11 but I had the very bad to surprise that all accented chars in the whole database has been replaced by garbled characters!
This is a big problem... Collation is latin1_swedish_ci...

Re: Installation scrambled all accented chars

Posted: Thu Aug 02, 2012 3:13 pm
by zigge
My upgrades from 1.10.2 and 1.10.3 to 1.11 worked without these problems. Also using latin1_swedish_ci for collation(Swedish website).

Did you export/import to a new databse and the upgrade or did you upgrade right of on the existing database?

Your problem seems strange, and to mee seems more like a HTML/xHTML issue, since the upgrader does not touch the existing data or any DML on the tables in that sense.

Do you have an example?

Re: Installation scrambled all accented chars

Posted: Thu Aug 02, 2012 3:56 pm
by saltydog
zigge,

thanks for the reply.
In the meantime I have switched back to 1.10.3 and things got right, so I don't have an example. I have also investigated and found that the accented chars are garbled inside mysql tables: "en archè estì o logos" instead of "en archè estì o logos"...

But 1.10.3 will display them correctly (making a sort of decode/encode??) while 1.11 is displaying them as they are in the database.

I should correct things in mysql, but I don't know where to start from...

Re: Installation scrambled all accented chars

Posted: Thu Aug 02, 2012 4:33 pm
by zigge
Had this issue a year back when moving to another hosting company(export/import). Ended up with doing an export, search and replace on the garbled things, saved as Unicode, imported into database, and it was fixed. Less than an hours work really.

Also with the old hosting company, I had the same issue when exporting to CSV in FEU module. Added som string replace logic in the module code, but since my current provider uses a database with correct setting this is no longer neccessary.

If I where you, I would fix the data first.

Re: Installation scrambled all accented chars

Posted: Thu Aug 02, 2012 4:36 pm
by zigge
Btw, did your old config.php have any:

$config['default_encoding'] = 'utf-8';

And is it there in the new config.php?

Re: Installation scrambled all accented chars

Posted: Thu Aug 02, 2012 5:43 pm
by zigge
Btw, this is good reading. MySQL could even look at server locale....


http://www.bluebox.net/news/2009/07/mysql_encoding/

Re: Installation scrambled all accented chars

Posted: Thu Aug 02, 2012 8:08 pm
by janvl
What you see has to do with an encoding-error. UTF8 uses 2 bytes for the encoding that is why you see two characters. I had that with another PHP-programm once.
Try this in your config.sys

$config['locale'] = 'es_ES.UTF8';

I hope it helps.

Jan