2010-12-14

utf-8 on LAMP

If you manage LAMP applications you will run into character encoding issues soon or later.
You better stick to utf-8 at all layers: database, webserver, webframework.

While working with coppermine photo galery, after upgrading the framework, sometimes i get
badly encoded character. The DB is ok as the old and the new versions are running parallel and
the old delivers i18n characters just fine. the same apache is serving them so the last possibility
is to check the webframework. Which is unfortunately php, and I don't even know the syntax of it.

So here is a small reminder what should be changed:


function cpg_db_connect()
{
...
mysql_query('SET NAMES "utf8"', $result);
return $result;
}


this function is in include/functions.inc.php for coppermine.

2010-12-06

Installing perl modules

I was playing with the new Amazon service Amazon Route 53. It's using some perl scripts to call the webservice. After downloading the perl tools, and trying to use them i saw the following error message:

Can't locate Data/GUID.pm


I'm not a perl expert so first i tried to install the modules manually, but quickly i ended up in the perl dependency hell. So figured out that one of the tools which make installing perl modules easier is CPAN

so here is a quick reminder how i did the install


sudo perl5.10.0 -MCPAN -e 'shell'

cpan[1]> install Data::GUID