[horde] Identity and Signature emty after upgrade to Horde 4

Xavier Montagutelli xavier.montagutelli at unilim.fr
Wed Nov 9 12:01:53 UTC 2011


On Tuesday 08 November 2011 16:24:11 Makeri wrote:
> Montagutelli Xavier <xavier.montagutelli <at> unilim.fr> writes:
> > What character set do you use ?
> > 
> > I got the same problem during my last test. It was due to a problem of
> > character encoding : our old database was in UTF-8, Horde 3 in
> > "iso-8859-1" (latin1). In the new setup, both MySQL and Horde 4 are
> > utf8. I had to recode the "identities" preferences to recover them. If
> > your problem is not corrected by the fix announced by Jan, and is
> > related to character encoding, let me know and I will give you my
> > script.
> > 
> > --
> > Xavier
> 
> Hi !
> 
> I test it today - and the identities are away.
> 
> mysql is utf-8
> 
> What did you mean with "horde-encoding" ? Where can i see it ?

Sorry for the explanation, the encoding is a bit confusing for me.

In horde/config/conf.php (or in Administration -> Configuration -> Database 
under the web interface) :

$conf['sql']['charset'] 

This parameter was previously 'iso-8859-1', whereas the SQL database was in 
utf-8 (CREATE DATABASE horde31 DEFAULT CHARACTER SET 'utf8';). In the new 
setup, I changed $conf['sql']['charset'] to be 'utf-8' also.

The problem is related to the way the string for the "identities" preference 
is serialized by PHP, and utf-8 character taking 2 bytes, not one. 

I.e., in the old setup, the string "Identité" in french (Identity in english) 
was serialized with a length of 8 chars (s:8:"Identité"). In the new setup, it 
should be 9 chars, because the accentuated char é is 2 bytes. So the 
unserialization doesn't work after transfering the old database, because the 
lenght is not correct anymore ! And the identities don't appear.


> How you recode it ? What a script ? Can you it send me ?

This is a very very ugly script. It works for me ... even if I can't 
completely explain why, sorry ...

HTH,

-- 
Xavier Montagutelli
http://twitter.com/#!/XMontagutelli
Service Commun Informatique - Universite de Limoges
123, avenue Albert Thomas - 87060 Limoges cedex
Tel : +33 (0)5 55 45 77 20 /   Fax : +33 (0)5 55 45 75 95
-------------- next part --------------
A non-text attachment was scrubbed...
Name: convert-pref-utf8.php
Type: application/x-php
Size: 1695 bytes
Desc: not available
URL: <http://lists.horde.org/archives/horde/attachments/20111109/c85d1625/attachment.bin>


More information about the horde mailing list