WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] DB_CHARSET & DB_COLLATE: Required? (3 posts)

  1. mhulse
    Member
    Posted 9 months ago #

    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?

  2. catacaustic
    Member
    Posted 9 months ago #

    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.

  3. mhulse
    Member
    Posted 9 months ago #

    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". :D

    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. :)

Reply

You must log in to post.

About this Topic