Drewbert
21st October 2006, 07:57 AM
If you have any PERL CGI programs and ou're looking for a fast way to set their HTML charset output to UTF-8 from the default ISO-8859, it's real simple...
After creating the new CGI object...
my $q = CGI->new();
simply add...
$q->charset('UTF-8');
Once you have done that, the default charset placed in the header is changed for every page that object creates.
Saves having to arse around with header settings in multiple places in your CGI scrpt.
One warning though, you need a fairly recent CGI.pm perl module on your server.
If it doesn't work, download the latest CGI.pm
#cpan
cpan>install CGI
Easy as that.
After creating the new CGI object...
my $q = CGI->new();
simply add...
$q->charset('UTF-8');
Once you have done that, the default charset placed in the header is changed for every page that object creates.
Saves having to arse around with header settings in multiple places in your CGI scrpt.
One warning though, you need a fairly recent CGI.pm perl module on your server.
If it doesn't work, download the latest CGI.pm
#cpan
cpan>install CGI
Easy as that.