I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2011-12-16 06:01:44.954978-08 by ralf
Problem to get UTF8-CSV-File
Hallo,

We have a problem. We want to get an UTF8-CSV-File from UTF8-Oracle-Database. It seems to be that the CSV-File is always charset "latin-1". What can we do to get UTF-8-File? Here is our Testscript.
#------ our Testscript------------------------# #!/usr/local/bin/perl -w -C64 use strict; use bytes; use open IO => ":utf8"; use DBI; my %Param; my $Select; my $Dsn="dbi:Oracle:samsafe"; my $User="UUUUUU"; my $Passwd="XXXXXX"; $ENV{NLS_LANG}="GERMAN_GERMANY.AL32UTF8"; $Select="select ku.knd_name1,ku.knd_name2,ku.knd_str,ku.knd_hausnr,ku.knd_plz,ku.knd_ort\n"; $Select.="from wd_kunde ku\n"; $Select.="where ku.knd_vorid=1001586\n"; system("rm Test.csv"); my $dbh=DBI->connect('dbi:AnyData(RaiseError=>1):f_encoding => "utf8"'); my $oracle_dbh=DBI->connect($Dsn,$User,$Passwd); my %OraFlags; $OraFlags{sql}=$Select; $OraFlags{col_names}="knd_name1,knd_name2,knd_str,knd_hausnr,knd_plz,knd_ort"; $dbh->func('wd_kunde','DBI',$oracle_dbh,\%OraFlags,'ad_import'); $dbh->func('wd_kunde','CSV','Test.csv','ad_export'); my $sth=$dbh->prepare($Select); $sth->execute();
With friendly regards
Ralf
Direct Responses: Write a response