[ic] UTF-8 in MySQL

Ivan Kurmanov iku at tut.by
Wed Mar 8 03:08:59 EST 2006


On 2006-03-07, Elver Loho wrote:
...
> Um, dude. That's the problem right now with our new table. We're
> storing UTF-8 text as UTF-8 in the database. Interchange doesn't issue
> 'set names utf8' or 'set character set utf8' in order to read those
> fields. How can we tell it to?

'set names utf8' and 'set character set utf8' change server configuration
variables.  But you don't have to issue these statements to change them: there
are other ways to influence them.  For instance, via the MySQL option files
(/etc/my.cnf).  Or via server start-up command-line options.

For example, you can add this to /etc/my.conf 

[mysqld]
character_set_client=utf8
character_set_results=utf8
character_set_connection=utf8

and it should work exactly as 'set names utf8' at the start of each MySQL
session.  
http://dev.mysql.com/doc/refman/5.0/en/charset.html
http://dev.mysql.com/doc/refman/5.0/en/option-files.html
http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html


But I'm afraid this is not enough to make IC support UTF-8.  Because there's
much more involved: decoding data that you get from the database in perl,
(also, from other databases and files), decoding data that you get from the
users via cgi, encoding data that you write, setting charset of the pages
output...

I tried to do this, and I made just the beginning of the job.  Then I gave up.
I published my patch for someone to take over http://ahinea.com/en/tech/ic/unicode.html
and finish, and Gert van der Spoel (on this list) mentioned in a private mail,
that he would try.


Ivan
http://ahinea.com/en/


More information about the interchange-users mailing list