[HELP!] perl and unicode are not working
676831Feb 25 2010 — edited Mar 3 2010I have a database that I know supports Unicode, I'm trying to read/write data using perl and I'm pulling my hair out! I have a table populated with some Unicode characters that I inserted using TOAD and this sql statement:
insert into jay_test values (-101, 'Τη γλώσσα μου έδωσ');
When I look at the data in TOAD everything looks great, when I read the data out using .NET it works great, when I read it out using PERL the result if a bunch of question marks.
Here is the code:
#!/usr/bin/perl -w
<%
use utf8;
use DBD::Oracle;
$Response->AddHeader("Content-Type","text/html; charset=utf-8;");
my $dbh2 = DBI->connect($db, $user, $password, {AutoCommit => 1});
my $x = $dbh2->ora_can_unicode();
my $sth = $dbh2->prepare("SELECT i, j from jay_test order by i desc");
$sth->execute();
while (my ($i, $j) = $sth->fetchrow_array()) {
debug("i = $i, j = $j");
$html .= qq{
<tr>
<td>$i</td>
<td>$j</td>
</tr>
};
}
The result is this:
-101 ?? ?????? ??? ????
As a note: the line "$dbh2->ora_can_unicode();" returns a value of 3, which means that Unicode should be fully supported.
Anyone who can point me in the right direction will be my savior! Thanks in advance