cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "marco turchi" <marco.tur...@gmail.com>
Subject Re: UTF8 problem
Date Sun, 03 Jun 2007 18:21:24 GMT
Dear Andrus,
first of all, thanks a lot for your patience.

I have created a new database using character set utf-8, and colletion utf8...
Then i set the following variables:
 SET character_set_server = utf8;
 SET character_set_client = utf8;
 SET character_set_db = utf8;
now the "status" command gives me:
Server characterset:    utf8
Db     characterset:    utf8
Client characterset:    utf8
Conn.  characterset:    utf8

then i create a test table:
create table prova ( id_prova  int(11) NOT NULL auto_increment,
description longtext, PRIMARY KEY  (id_prova) ) character set  utf8;
and I have filled it with utf8 data.

and now....
...
...
it works!!!!!!!!!!!!

As a test, I try to fill the test table with the data in the old
table, and I get the same wrong situation because they are latin1.
The point, like you told me, is that the data in my old table are not
utf8, I hope to be able to convert them...
Thanks for everything
Marco




On 6/3/07, Andrus Adamchik <andrus@objectstyle.org> wrote:
>
> On Jun 2, 2007, at 9:43 PM, marco turchi wrote:
>
> > | summary       | longtext     | utf8_general_ci | YES  |
> > | description   | longtext     | utf8_general_ci | YES  |
>
> I believe the third column is "collation", not "encoding"; so
> encoding is still "latin".
>
>
> > My idea is that the data are encoding UTF8 inside the table, but when
> > Cayenne creates a connection, all the data that pass through that
> > connection are encoding latin1. Is it right?
>
> Disclaimer *** : I've never tried the advise below myself, only found
> it in MySQL docs. So I suggest taking a full MySQL dump from your
> production DB, loading it to an offline test DB, and trying it there
> first, before applying to production.
>
>
>
> With ALTER DATABASE and ALTER TABLE you can change the default
> database charset and a default table charset on MySQL 5.0:
>
> http://dev.mysql.com/doc/refman/5.0/en/alter-database.html
> http://dev.mysql.com/doc/refman/5.0/en/alter-table.html
>
> Be careful with various ALTER TABLE charset options. According to the
> docs there are different ways to address a number of related but
> distinct charset conversion issues. You need to pick the one that is
> appropriate for you. So definitely do it on a test DB first.
>
> Good luck!
> Andrus
>
>
>
>

Mime
View raw message