vBulletin character set & collation, double check phpmyadmin / MySQL for charset settings
vBulletin and UTF8 defaults
To set UTF8 throughout, you’ll need for MySQL server, connection, database and table and table columns to all be UTF8 character set and UTF8 collation (utf8_generical_ci).
For MySQL server end, edit /etc/my.cnf or wherever MySQL my.cnf is and set [client] and [mysqld] groups to have the line
| character_set_client | latin1 | | character_set_connection | latin1 | | character_set_database | latin1 | | character_set_filesystem | binary | | character_set_results | latin1 | | character_set_server | latin1 | | character_set_system | utf8 | | character_sets_dir | /usr/share/mysql/charsets/ | | collation_connection | latin1_swedish_ci | | collation_database | latin1_swedish_ci | | collation_server | latin1_swedish_ci |
i.e.
[client] default-character-set=utf8 [mysqld] default-character-set=utf8 |
[box type=”shadow”]Note: this default-character-set option applies to MySQL version default-character-set option was deprecated from >MySQL 5.5.3 in favor of character-set-server variable.[/box]
So for MySQL versions >5.5.3 use
[mysqld] character-set-server=utf8 |
Then after editing my.cnf, restart MySQL server and using one of the 4 methods outlined above, double check to see if UTF8 is set correctly. When set correctly the variables will show up as follows:
[root@centos6 ~]# mysqladmin var | grep -E '(character|collation)' | character_set_client | utf8 | | character_set_connection | utf8 | | character_set_database | utf8 | | character_set_filesystem | binary | | character_set_results | utf8 | | character_set_server | utf8 | | character_set_system | utf8 | | character_sets_dir | /usr/share/mysql/charsets/ | | collation_connection | utf8_general_ci | | collation_database | utf8_general_ci | | collation_server | utf8_general_ci |
For vBulletin config.php you want to change from
---------------------------------------------------------------------------------------------------- Check vB config.php settings: ---------------------------------------------------------------------------------------------------- $config['Database']['dbtype'] = 'mysql'; // $config['Mysqli']['charset'] = 'utf8'; |
to
---------------------------------------------------------------------------------------------------- Check vB config.php settings: ---------------------------------------------------------------------------------------------------- $config['Database']['dbtype'] = 'mysqli'; $config['Mysqli']['charset'] = 'utf8'; |
Ensuring PHP was compiled with mysqli support.
Then in vB AdminCP -> Language Manager -> Edit settings -> HTML Character Set change to UTF-8 or whatever character set you need. A full list of HTML Character sets are available here.
Ideally, if you operate a non-English language vBulletin forum, you’d want to have all the above outlined UTF8 settings configured from the start BEFORE installing and creating vBulletin MySQL database. Unfortunately, if you started with default latin1 character set for vBulletin installation, it can be complicated trying to convert your forum database over from latin1 to UTF8 charset and collation and will involve some trial an error to get right. If you do try conversion, always backup your vBulletin database first and download it to safe place on your pc, and then only try the conversion on a test copy of your live database or better yet on a local test server.
If you operate a non-English language vBulletin forum and have successfully converted from latin1 or non-latin1 to UTF8 character set and collation, feel free to share your experiences and steps you took for the conversion in the comment section below.