Support » Installing WordPress » DB_CHARSET & DB_COLLATE: Required?

  • Resolved mhulse


    When starting a new installation, can I omit the DB_CHARSET & DB_COLLATE constants? Reading the docs, it appears as though utf8 is the default value for the charset, and collate should be null.

    If I remove the defines from my config (before installing), is that the same as saying:

    define('DB_CHARSET', 'utf8');
    define('DB_COLLATE', '');

    In other words, if WordPress’ assumed default values for these constants suffice, do I need to have those lines set in my config?

Viewing 2 replies - 1 through 2 (of 2 total)
  • catacaustic


    very awesome

    They are defined as constants because they are used elsewhere in the code. Removing them is not the same as setting them to some default value, although depending on your error reporting level you might not notice the difference.

    Thanks for the reply catacaustic!

    Based on your answer, I’ll leave them there then. Thanks for the clarification, I really appreciate it.

    The only reason I asked is that there are, from what I can tell, a lot of other constants that I don’t define, yet they have assumed default values.

    I was kinda hoping that DB_CHARSET and DB_COLLATE might behave the same way and there would be code elsewhere that pseudo-says “if not set, then use utf8 and collate like I’d collate if null string was defined”. 😀

    The goal would be to simplify config file and set only the things that are required.

    I’m definitely reporting all errors/warnings to the log file, so I would be annoyed if this warned me all the time for not defining one/both of the above constants.

    Anyway, thanks again! Sorry to chat your ear off. 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘DB_CHARSET & DB_COLLATE: Required?’ is closed to new replies.