Friday, August 08, 2008

MySQL JDBC Memory Usage on Large ResultSet

MySQL JDBC Memory Usage on Large ResultSet

Wednesday, August 06, 2008

Apache Velocity Servlets + UTF-8 = love

If you have problems outputting UTF-8 with Apache Velocity, create a file called velocity.properties under the WEB-INF folder and add the following 2 lines:

input.encoding=utf-8
output.encoding=utf-8
XML-RPC for PHP Library + UTF-8 = love

If you have problems with the XML-RPC for PHP library (http://phpxmlrpc.sourceforge.net/) and UTF-8, please be advised that in xmlrpc.inc you will find the following lines:

// The charset encoding used by the server for received messages and
// by the client for received responses when received charset cannot be determined
// or is not supported
$GLOBALS['xmlrpc_defencoding']='UTF-8';

// The encoding used internally by PHP.
// String values received as xml will be converted to this, and php strings will be converted to xml
// as if having been coded with this
GLOBALS['xmlrpc_internalencoding']='ISO-8859-1';

As you can see, internally everything seems to be converted to ISO-8859-1, no idea why. If you change this to
$GLOBALS['xmlrpc_internalencoding']='UTF-8';
you will be able to use UTF-8 correctly with the library.

Monday, August 04, 2008

MySQL + PHPMyAdmin + UTF-8 = love

Add the following to the [mysqld] section in /etc/mysql/my.cnf:

character_set_server = utf8
collation_server = utf8_general_ci
default-character-set=utf8

Adding AddDefaultCharset UTF-8 to /etc/apache2/conf.d/charset also helps with some web apps.

Tested on Ubuntu 8.04 Hardy