Unicode

From Dev411: The Code Wiki

Table of contents

Languages

Perl

General

use encoding 'utf8'

CGI & DBI Andrew Forrest has put together UTF-8 compatible versions of CGI.pm and DBI.pm

DBD::mysql Use of unicode with DBD::mysql is problematic and there may be no solution soon.

Some developers have switched to PostgreSQL to avoid having to deal with DBD::mysql workarounds.

Web Servers

Apache

If you are using Apache you can set the default charset in httpd.conf:

AddDefaultCharset UTF-8

HTML Pages

If you are creating webpages with Perl's CGI.pm you can set the charset in the header method:

print $q->header( -type => 'text/html', -charset => 'UTF-8' );

Further Reading / External Links