Fwd: Problem to get UTF8-CSV-File

Jens Rehsack <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.dbi.general
Message-ID <CAANR1XGKUgk3P2D-3Lzdo0hcBG+4nF+K2e=dOGt1ESVxzava=A@mail.gmail.com>
---------- Weitergeleitete Nachricht ----------
Von: Ralf Eiteljörge <[email protected]>
Datum: 21. Dezember 2011 14:06
Betreff: Problem to get UTF8-CSV-File
An: [email protected]


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

Ralf Eiteljoerge
------------------------------------------
ProUnix GmbH
Heinemannstr. 34
53175 Bonn
------------------------------------------
Telefon: +49-228-18466-774
Fax....: +49-228-18466-66
Mobil..: +49-177-3130158
E-Mail.: [email protected]
Web....: www.prounix.de
------------------------------------------



Prounix Gesellschaft für Softwareentwicklung mbH - Geschäftsführer:
Markus Glaz, Andreas Decker - Handelsregister: Amtsgericht Bonn HRB
5855 - Sitz der Gesellschaft: Bonn
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.