【发布时间】:2020-10-20 01:42:36
【问题描述】:
我有一个包含中文文章列表的数据库,当我尝试查询以获取所有文章名称时遇到问题,我看到的只是 ???而不是中文文本。
my $db_connection = DBI->connect("DBI:mysql:host=localhost;database=articles", 'root', '');
my $con = $db_connection->prepare( "select * from articles" );
$con->execute;
while (my $infoD = $con->fetchrow_hashref())
{
$INFO{$infoD->{name}} .= decode('utf8', $infoD->{name});
}
【问题讨论】: