perl-i18n

Character Encoding (UTF-8) in PERL

2007-05-10 00:09:09
Hello list,
we have used Debian (3.1) Sarge for almost 2 years on our serverand everything 
was encoded in UTF-8.

When Debain Etch (4.0) came out we read that everything in Etch now defaults 
to UTF-8 character encoding so we decided to upgrade from from Sarge to Etch.

Sarge
====
Kernel 2.4.27
Apache 2.0.54
mysql 4.0.24 
Perl 5.8.4

Etch
====
Kernel 2.6.18
Apache 2.2.3
mysql 5.0.32
Perl 5.8.8

Unfortunately after the upgrade the character encoding on our website was 
messed up and it looks like the reason for that is PERL.

The operating system and Apache seem to use UTF-8. So, that's good!

In mysql everything looks fine, too:
mysql> SHOW VARIABLES LIKE "character_set_%";
+--------------------------+----------------------------+
| Variable_name            | Value                      |
+--------------------------+----------------------------+
| character_set_client     | utf8                       |
| character_set_connection | utf8                       |
| character_set_database   | utf8                       |
| character_set_filesystem | binary                     |
| character_set_results    | utf8                       |
| character_set_server     | utf8                       |
| character_set_system     | utf8                       |
| character_sets_dir       | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+

However a PERL script with dbh->do(SHOW VARIABLES LIKE "character_set_%"); 
returns:
character_set_client      latin1
character_set_connection  latin1
character_set_database    utf8
character_set_filesystem  binary
character_set_results     latin1
character_set_server      utf8
character_set_system      utf8
character_sets_dir        /usr/share/mysql/charsets/

How can we tell PERL to use UTF-8 as default encoding?

Thanks
-- 
Best regards,
Oliver König

<Prev in Thread] Current Thread [Next in Thread>