[Erp5-dev] Using another character set and collation

Kazuhiko Shiozaki kazuhiko at nexedi.com
Thu Jul 31 10:34:06 CEST 2008


Hi Boris,
I'm sorry for late reply.

Boris Kocherov wrote:
> As i have tested two things should solve this problem.
> 1) run this sql query
> "ALTER DATABASE db_name CHARACTER SET utf8"
> 
> 2) use attached patch
> 
> After all do not forget to clean and reindex catalog.
> 
> I want to commit this patch in trunk. What should i do for that?
> 
> I think that change default charset is not a good idea - the different 
> applications which are using mysql may need different default charset.

Since sorting and collation in ERP5 (w/ catalog) depends on MySQL's
behaviour, wrong communication between ERP5 and MySQL causes unexpected
results.

There are two ways to solve this character set problem.

A. force MySQL to use utf8 without character set handshaking
------------------------------------------------------------

This is easy. Just add the following into [mysqld] section in your my.cnf.

  default-character-set=utf8
  skip-character-set-client-handshake

As you mentioned, this configuration is too global and can affect other
applications that use the same MySQL.

B. modify ERP5 to specify character set explicitly
--------------------------------------------------

To take this way, your proposal 1) and 2) are not enough. It is also
needed to add 'DEFAULT CHARSET=utf8' at the end of *all* CREATE TABLE
statements (in portal_catalog/*/z_create_*).

With this way, you don't have to care MySQL configuration, but you have
to take care when you add new tables in ERP5.


BTW, if you are interested in multilingual fulltext search in ERP5, the
following uri might be interesting.
http://www.erp5.org/HowToUseTritonn

Regards,
-- 
Kazuhiko Shiozaki, Nexedi SA Senior Consultant
Nexedi: Consulting and Development of Free / Open Source Software
http://www.nexedi.com
ERP5: Full Featured High End Open Source ERP
http://www.erp5.com
ERP5 Wiki: Developer Zone for ERP5 Community
http://www.erp5.org



More information about the Erp5-dev mailing list