Google Mail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
How to set database encoding?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Follow-up To:
Add Cc | Add Follow-up to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers that you hear
 
littlexiang  
View profile   Translate to Translated (View Original)
 More options 4 July, 15:07
From: littlexiang <littlexiang...@gmail.com>
Date: Sat, 4 Jul 2009 07:07:58 -0700 (PDT)
Local: Sat 4 July 2009 15:07
Subject: How to set database encoding?
I've tried these
            $manager->setAttribute
(Doctrine::ATTR_DEFAULT_TABLE_CHARSET,'utf8');
            $manager->setAttribute
(Doctrine::ATTR_DEFAULT_TABLE_COLLATE,'utf8_unicode_ci');
            $manager->setCollate('utf8_unicode_ci');
            $manager->setCharset('utf8');
            Doctrine_Query::query('SET NAMES utf8');

but none works.....


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
徐加杰 Jayson Xu  
View profile   Translate to Translated (View Original)
 More options 4 July, 15:36
From: Jayson Xu(徐加杰) <superjava...@gmail.com>
Date: Sat, 4 Jul 2009 22:36:13 +0800
Local: Sat 4 July 2009 15:36
Subject: Re: [doctrine-user] How to set database encoding?

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:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
littlexiang  
View profile   Translate to Translated (View Original)
 More options 4 July, 17:27
From: littlexiang <littlexiang...@gmail.com>
Date: Sat, 4 Jul 2009 09:27:53 -0700 (PDT)
Local: Sat 4 July 2009 17:27
Subject: Re: How to set database encoding?
好吧...

问题是,我是从数据库直接生成类的.

yml的效果应该就是在类中setUp方法里有

$this->option('collate', 'utf8_unicode_ci');
$this->option('charset', 'utf8');

这个我也试过 还试过dsn串后面+?charset=

都没有效果......难道要用RawSql解决?

On Jul 4, 10:36 pm, Jayson Xu(徐加杰) <superjava...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
徐加杰 Jayson Xu  
View profile   Translate to Translated (View Original)
 More options 5 July, 05:07
From: Jayson Xu(徐加杰) <superjava...@gmail.com>
Date: Sun, 5 Jul 2009 12:07:27 +0800
Local: Sun 5 July 2009 05:07
Subject: Re: [doctrine-user] Re: How to set database encoding?

you have to rebuild your table after change these options.

and I think the problem may be in your database setting,

check out the *default-character-set* in your my.cnf is utf8

2009/7/5 littlexiang <littlexiang...@gmail.com>


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
littlexiang  
View profile   Translate to Translated (View Original)
 More options 5 July, 12:33
From: littlexiang <littlexiang...@gmail.com>
Date: Sun, 5 Jul 2009 04:33:26 -0700 (PDT)
Local: Sun 5 July 2009 12:33
Subject: Re: How to set database encoding?
But most conditions you cannot change the settings, for example the
virtual hosts.

I am sure the db and tables are all utf8

On Jul 5, 12:07 pm, Jayson Xu(徐加杰) <superjava...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
littlexiang  
View profile   Translate to Translated (View Original)
 More options 5 July, 12:49
From: littlexiang <littlexiang...@gmail.com>
Date: Sun, 5 Jul 2009 04:49:38 -0700 (PDT)
Local: Sun 5 July 2009 12:49
Subject: Re: How to set database encoding?
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?


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google