I
think the setAttribute(Doctrine::ATTR_DEFAULT_TABLE_CHARSET,'utf8');
only works in the version 1.2 or later,
for 1.1, you can set your table collate and charset in the scheam.yml like
this
options:
type: INNODB
collate: utf8_unicode_ci
charset: utf8
User:
tableName: users
On Sat, Jul 4, 2009 at 10:07 PM, littlexiang <littlexiang...@gmail.com>wrote:
> I
> think the setAttribute(Doctrine::ATTR_DEFAULT_TABLE_CHARSET,'utf8');
> only works in the version 1.2 or later,
> for 1.1, you can set your table collate and charset in the scheam.yml like
> this
> options:
> type: INNODB
> collate: utf8_unicode_ci
> charset: utf8
> User:
> tableName: users
> On Sat, Jul 4, 2009 at 10:07 PM, littlexiang <littlexiang...@gmail.com>wrote:
> On Jul 4, 10:36 pm, Jayson Xu(徐加杰) <superjava...@gmail.com> wrote:
> > I
> > think the setAttribute(Doctrine::ATTR_DEFAULT_TABLE_CHARSET,'utf8');
> > only works in the version 1.2 or later,
> > for 1.1, you can set your table collate and charset in the scheam.yml
> like
> > this
> > options:
> > type: INNODB
> > collate: utf8_unicode_ci
> > charset: utf8
> > User:
> > tableName: users
> > On Sat, Jul 4, 2009 at 10:07 PM, littlexiang <littlexiang...@gmail.com
> >wrote:
> > On Jul 4, 10:36 pm, Jayson Xu(徐加杰) <superjava...@gmail.com> wrote:
> > > I
> > > think the setAttribute(Doctrine::ATTR_DEFAULT_TABLE_CHARSET,'utf8');
> > > only works in the version 1.2 or later,
> > > for 1.1, you can set your table collate and charset in the scheam.yml
> > like
> > > this
> > > options:
> > > type: INNODB
> > > collate: utf8_unicode_ci
> > > charset: utf8
> > > User:
> > > tableName: users
> > > On Sat, Jul 4, 2009 at 10:07 PM, littlexiang <littlexiang...@gmail.com
> > >wrote:
options:
collate: utf8_unicode_ci
charset: utf8
It is worth noting that for certain databases (Firebird, MySql and
PostgreSQL) setting the
charset option might not be enough for Doctrine to return data
properly. For those databases,
users are advised to also use the setCharset function of the database
connection:
$conn = Doctrine_Manager::connection();
$conn->setCharset('utf8');
search the manual again and find the key point......
MySQL is different from others in this way.
Anyway thanks man. Are u from China too? Or maybe HK, TW?