perl的CGI中文乱码?

perl的CGI中文乱码?

版本:

[Copy to clipboard] [ - ]
CODE:
Mysql :Server version          4.1.2
Apache:  Server version: Apache/2.0.52
Perl: This is perl, v5.8.5 built for i386-linux-thread-multi

Perl 连接MYSQL数据库的代码

[Copy to clipboard] [ - ]
CODE:
#!/usr/bin/perl
#
# date : 2007.11 .28
#
# author: weblily
use warnings;
use strict;
use CGI qw (:standard);
use DBI;
print header(-charset=>"UTF-8");
print start_html("Mysql connect testing");
# Connect to target DB
my $dbh = DBI->connect("DBI:mysql:database=phpbbs;host=localhost","phpbbsuser","admin12", {'RaiseError' => 1});

# query

my $sqr = $dbh->prepare("SELECT username FROM phpbb_users");
$sqr->execute();

print '<table border = "1" bgcolor= "cyan"  width = "25%">';
while(my @row = $sqr->fetchrow_array()) {
    print Tr(td(@row));
            }
print '</table>';
$dbh->disconnect();

数据库字符集

[Copy to clipboard] [ - ]
CODE:
mysql> SHOW   VARIABLES   LIKE   "character_set_%";  
+--------------------------+----------------------------+
| Variable_name            | Value                      |
+--------------------------+----------------------------+
| character_set_client     | utf8                       |
| character_set_connection | utf8                       |
| character_set_database   | utf8                       |
| character_set_results    | utf8                       |
| character_set_server     | utf8                       |
| character_set_system     | utf8                       |
| character_sets_dir       | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
7 rows in set (0.00 sec)

测试地址:
www.weblily.cn/cgi-bin/index.pl

这个显示出来有个中文乱码,请各位老师帮忙。
Don`t go down ! up !
可以修改如下:
my $sqr = $dbh->prepare("set names gbk");
$sqr->execute();
my $sql= $dbh->prepare("SELECT username FROM phpbb_users");
$sql->execute();
while(my @row = $sql->fetchrow_array()) {
    print Tr(td(@row));
            }
print '</table>';
$dbh->disconnect();
use UTF8;
显示正常啊
我这里也是显示正常。
是不是browse 编码没有选对啊。