Share with:


The final migration stage from file-based Ganntproject to Web-based solution just began. I’ve set up PHProject in the office site. PHP5, Apache2, Mysql4 and Debian is enough.

The very first problem was Unicode support. Seems like PHProject was developed keeping MySQL3 in mind, althow ir works with a bunch of database backends, like Oracle, PostgreSQL, DB2, MSSQL.

So, to use UTF8 encoding in MySQL, add the following into lib/db/mysql.inc.php:

$_database_ressource_identifier = mysql_connect($db_host, $db_user, $db_pass) or mysql_error();
+++ mysql_query(“SET NAMES ‘utf8′”);
+++ mysql_query(“SET CHARACTER_SET ‘utf8′”);
$_database_connection = mysql_select_db($db_name);

The second task is to convert the whole database, using character set ‘latin1’ and collation ‘latin1_swedish_ci’ to UTF-8. There are ~47 tables in the database, so manual conversion is a pain in the ass. My ass. You can use the SQL script for PHProject-5.2.2.

And the third task is to convert localization files from 8-bit to UTF-8. I’ve used iconv:

> ‘iconv -f windows-1257 -t utf8 lang/lt.inc.php.old > lang/lt.inc.php

So, here are the files:

A little PHP script that will convert database and tables to UTF-8. However, i’ve found it too late.