Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1098319
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T00:33:47+00:00 2026-05-17T00:33:47+00:00

At the moment, I am setting my table charset and collation like this: class

  • 0

At the moment, I am setting my table charset and collation like this:

class Model extends Doctrine_Record
{

  public function setTableDefinition()
  {
    //...

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

}

I am setting this in all my table definitions. Is there a way to set a default value?
In my bootstrap I am setting other default values like this:

Doctrine_Manager::getInstance()->setAttribute(
    Doctrine::ATTR_DEFAULT_IDENTIFIER_OPTIONS,
    array('name' => 'id', 'type' => 'integer', 'length' => 4));

Would be nice, if there was a way to do the same for collate and charset.
I found constants for it, but couldn’t find where/if they were ever used somewhere.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T00:33:48+00:00Added an answer on May 17, 2026 at 12:33 am
    Doctrine_Manager::connection('mysql://user:pass@host/schema')
        // This must be the charset of your HTTP header 
        // header('Content-Type: text/html;charset=utf-8');
        // or your HTML Head tag
        // <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        ->setCharset('UTF8')
        ;
    

    This is all you need (even with latin1 tables, accentued e for example will be saved correctly).

    But to be honest, it is best to stick to the same charset throughout your system (DB, HTML) as you can loose some data (e.g. chinese characters inputed on your site won’t be saved in your latin1 tables)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Till this moment I used this method to invoke: public string AddText { set
I'm currently setting all of the values of my class object Record . This
Probably a doh moment, but can't get this codebehind function to fire. In fact
I have an option to help setting up a server but at the moment
At the moment I have an array constructed like this: Car[] garage = new
I noticed a moment ago that my .gitconfig -file was public at my repo.
I followed this guide: http://wiki.unto.net/setting-up-clojure-and-slime Which walked me through the steps of building Clojure
This seems like it should be simple but I can't work out how to
I'm working in SQLAzure at the moment. I'm setting up a design where each
I'm setting up my first build server for .NET 3.5 projects, and found this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.