xiaoyafeng has asked for the wisdom of the Perl Monks concerning the following question:
Oracle's char-set is AMERICAN_AMERICA.utf8. Does I need to set char-set of Oracle in my script?use strict; use warnings; use DBI; binmode(STDOUT, ":utf8"); #my $dbh = DBI->connect(qq(dbi:Oracle:Athenadb), qq(athena), qq(athena +),{RaiseError => 1, ora_charset => 'AL32UTF8'}); my $dbh = DBI->connect(qq(dbi:ADO:Provider=MSDAORA.1;Data Source=Athen +aDB), qq(athena), qq(athena), {RaiseError => 1}); my $statment = "select ADAS_ID, ADAS_Name from ADAS_DEVICE"; my $sth = $dbh->prepare($statment) or die dbh->errstr; $sth->execute or die dbh->errstr; while (my ($ADAS_ID, $ADAS_NAME) = $sth->fetchrow_array) { print "$ADA +S_NAME ID is $ADAS_ID \n";} __OUTPUT__ 忙聼鲁忙聻聴忙聳৸ +3;氓楼楼莽潞?35 ID is 296827 忙聼鲁忙聻聴茅聻ೖ +9;氓聨聜莽潞?36 ID is 296890 忙聼鲁忙聻聴茅聭ഐ +6;氓聼聨莽潞?33 ID is 296913 忙聼鲁忙聻聴猫楼ི +0;忙聼鲁莽潞?42 ID is 268542
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: set unicode in perl
by EvanK (Chaplain) on Aug 08, 2008 at 04:10 UTC | |
by xiaoyafeng (Deacon) on Aug 08, 2008 at 07:20 UTC | |
by mje (Curate) on Aug 08, 2008 at 08:36 UTC |