• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Not planned Charset & collation options in config.php

Fred.

Well-known member
#1
I would like to have the option to change charset and collation, it would be easy if we could set it in config.php

Code:
// do not change unless you converted your db to the right charset - collation
$config['db'][‘charset'] = ‘utf8mb4’;
$config['db'][‘collation'] = ‘utf8mb4_general_ci';
 

Mike

XenForo developer
Staff member
#2
I'm thinking of calling this not planned, mostly because what you're suggesting in terms of character sets is likely more generic than we'd want to allow.

The only potentially valid character sets are utf8 and utf8mb4. However, beyond that, using utf8mb4 has effects elsewhere in the code so it's not something that we could just change without other things in the code changing. So on that basis, it doesn't make sense to allow you to "directly" modify the charset, instead just opting into using the full UTF-8 gamut. This is better tracked in this suggestion: https://xenforo.com/community/threads/true-utf-8-support-mysql-utf8mb4.90122/

There is some validity to allowing the collation to be changed, but that then needs to correspond with utf8 or utf8mb4 and there are some collations that will break some code assumptions (any "cs" collations and utf8_bin for example). I don't recall any particular requests for people to use more specific collations (though there may be). There would be some validity in that, though it's probably quite an edge case. Aside from username sorting, most sorts are by numeric values which won't be affected.

I'm sort of assuming that your request to change the collation is dependent on/related to the request to change the character set. As such, I'll call this not planned in the form you're requesting.
 

Fred.

Well-known member
#3
Ok, That makes sense. Yes, I would only allow utf8 and utf8mb4.
The reason I thought about this was because Drupal is doing it like that
https://www.drupal.org/project/utf8mb4_convert
I found that page and thought, hey XF could do that too.

I voted for utf8mb4 support in that thread before, let's hope we will see that in a future release.
Thanks for the info Mike :)