I have a PT that queries SQL Server to get a value from a table based on the file name. The result I am returned is in Chinese Characters that I want to be displayed on my on my web page. The problem is that Chinese characters are ????? (question marks). My web page shows Chinese characters, however any results from SQL Server display as ????. Here's my code from my PT.....any suggestions?
<IW_PERL>
<
DBC:database";
my $username = "username";
my $auth = "password";
$dbh = DBI->connect($db, $username, $auth); # should check return codes
$dbh-> {'LongTruncOk'} = 1;
$dbh-> {'LongReadLen'} = 65535; # for text type column
#now build my query
my $sqlstring = qq{Select RegularTitle From jk1_cn.dbo.tblHarvardXML Where MyFileName = N'$dcr_file'};
my $sth = $dbh->prepare( $sqlstring );
$sth->execute();
my
@row;
#output a link for the forum
while (
@row = $sth->fetchrow_array( ) ) {
iwpt_output( encode('UTF-8', "
@row")); #returns question marks
iwpt_output( "
@row"); #returns question marks
iwpt_output("題目內容"); #this works fine....chinese characters are displayed
}
$dbh->disconnect();
}
Can anyone help?......thanks in advance.....
pj