Unicode
From Dev411: The Code Wiki
| Table of contents |
[edit]
Languages
[edit]
Perl
General
use encoding 'utf8'
CGI & DBI Andrew Forrest has put together UTF-8 compatible versions of CGI.pm and DBI.pm
- Andrew Forrest's UTF-8 A-Go-Go: UTF8CGI.pm & UTF8DBI.pm (http://dysphoria.net/2006/02/05/utf-8-a-go-go/)
DBD::mysql Use of unicode with DBD::mysql is problematic and there may be no solution soon.
- utf-8 and DBD::mysql (http://www.simplicidade.org/notes/archives/2005/12/utf8_and_dbdmys.html)
- Movable Type, MySQL, Perl, Unicode (http://www.zackvision.com/weblog/2005/11/mt-unicode-mysql.html)
Some developers have switched to PostgreSQL to avoid having to deal with DBD::mysql workarounds.
[edit]
Web Servers
[edit]
Apache
If you are using Apache you can set the default charset in httpd.conf:
AddDefaultCharset UTF-8
[edit]
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' );
[edit]
Further Reading / External Links
- View and input Chinese charactors in an English system (http://nic-nac-project.de/~murj/blog/item/view-and-input-chinese-charactors-in-an-english-system)
