| Home Profile Fun |
#159 Linux 07.01.2008
vBulletin installation with UTF-8When I tried to install the german vBulletin forum software I realised that the default configuration is not for UTF-8. After the installation I saw incomplete strings in the forum and also in posts I made. The reason was that strings with german umlauts where cut off. After hours and hours of testing and attempting to make this nice software work properly with UTF-8 I found a way to do it. Please read the original vBulletin handbook before as I will explain only the steps necessary to get the UTF-8 charset. The first step is to verify that MySQL is running with UTF-8. mysql> show variables like '%char%'; +--------------------------+----------------------------+ | Variable_name | Value | +--------------------------+----------------------------+ | 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/ | +--------------------------+----------------------------+ 8 rows in set (0.00 sec) Then we test the Forum database for UTF-8. mysql> show create database ForumDB; +--------------------+-----------------------------------------------------------------------------+ | Database | Create Database | +--------------------+-----------------------------------------------------------------------------+ | ForumDB | CREATE DATABASE `ForumDB` /*!40100 DEFAULT CHARACTER SET utf8 */ | +--------------------+-----------------------------------------------------------------------------+ 1 row in set (0.00 sec) As soon as we have unzipped the vBulletin software package it's time to adapt the main configuration file upload/includes/config.php. Enable this uncommented line: $config['Mysqli']['charset'] = 'utf8'; Now we convert the character set of two language files from Latin1 to UTF-8. recode is a Linux shell command which should be available on a standard Linux system. recode latin1..utf8 upload/install/vbulletin-language-de-du.xml recode latin1..utf8 upload/install/vbulletin-language.xml After this operation you can run the installation script of vBulletin. You will still see broken strings due to the german umlauts. But this will vanish during the next steps. When this is done import the german language file we just have converted to UTF-8. To do so enter the administration console of vBulletin and import the file vbulletin-language-de-du.xml from the server via the language options and if available select the language in the drop down list. Then change the HTML character set in the language settings from ISO-8859-1 to UTF-8. The last step is to reload the administration page in the browser. That's it, all strings are displayed in full length with all special characters and umlauts. |