[horde] How encoding works in horde?

Jan Schneider jan at horde.org
Thu Jun 5 09:32:31 UTC 2008


Zitat von Piotr Legiecki <piotrlg at sci.pam.szczecin.pl>:

> Hi
>
> I'v been strugling with horde 3.1.3, mysql 5.0 to understand how
> encoding works there. the problem is, that I can't get properly working
> polish national characters (iso8859-2). Horde is set to:
> $conf['sql']['charset'] = 'iso-8859-2';
> is it enough?

Yes. The database table and columns should use that charset too, so  
that search and sorting queries work correctly.

> my linux console is set to iso-8859-2. When I create horde database
> (this is done by debian/stable package) it does not ask me what encoding
> I want to use for this database, and the create.mysql.sql script just
> does not mention anything about encoding. Should I force/set encoding of
> horde database during creation?

If you want to use it, yes. In MySQL charsets are inherited, so if you  
set the horde database to use latin2, the table created therein will  
use it too.

> horde itself (its www interface) is working in utf8 and it is talkig to
> me in polish very well. But when I add some content to database (turba
> address book, kronolith event) and the page reloads my polish characters
> from that content disappear ('?' instead).

Then you did something wrong, e.g. have some sql settings that  
override the global charset setting in $conf['sql']. Or your server  
doesn't support converting to and from the iso-8859-2 charset.

> I was trying to set encoding in database, horde to different values
> (utf8, latin1) to understand how it works and where the conversion
> process looses the encoding but it is magic to me.
>
> btw horde2/mysql4 worked ok on my old system.
>
> 1. I whish some good soul wold explain me about this encoding issues
> 2. What is the best aproach of using horde in non english environment?
> Should I set the database to latin2 or leave it with default (and
> default for my setup is latin1) values and let horde deal with it?

Best is to use utf-8 for everything, because that would require no  
conversion whatsoever, and allows for any characters outside of your  
latin charset.

Jan.

-- 
Do you need professional PHP or Horde consulting?
http://horde.org/consulting/



More information about the horde mailing list