hi,
I am struggling with a dirty little problem on a HPUX, using perl 5.003,
with oraperl.
I don't get the correct GERMAN characters reading the oracle-database. This
problem seems to stem from a systemupgrade on the HP (don't know which, HPUX
10.20, oracle 8 ?).
All other environments display and print german characters correctly (cobol
programs, sqlplus) , even within this script (I displayed a menu screen to
test this).
The script delivers correctly on the linux-testsystem, running perl 5.005,
with oraperl.
I have limited ability to upgrade any software on the HP (lengthy
discussions with systemadminstrator), therefor I would like to handle the
environment issue within the script.
The variable $beschr within report below gets only \x3F from the oracle
fetch for any special character (ä,ü,ö,ß,...). That means, that the
correctly stored german characters are translated to \x3F during transfer
from oracle to perl.
I have tried some environment modifications and compared the environment
variables whithout success.
eg:
#print STDOUT qq(\nVorher: $ENV{'NLS_LANG'}); # oracle scheint OK > sqlplus
#system ("stty sane -istrip cs8"); # stty scheint nicht zu
helfen
#`stty sane -istrip cs8`; # mit backtic wirds nciht
besser
#`stty=500:5:10b1:8a3b:3:1c:8:15:4:0:1:0:11:13:1a:0:12:f:17:16:0:0:73:0:0:0:
0:0:0:0:0:0:0:0:0:`; #njet, das war linux setting
Can you give me a hint what to do or where to look?
Kind regards
Franz
Here ist an example of the result
Hartmann F?rben von weiss
Hartmann F?rben von ROH
Hartmann F?rben von Farbe auf Farbe
Here goes the script:
#!/usr/bin/perl
# Purpose: REPORT KAARBGLI
# Usage: kaarbgli.pl
# Author: Franz Nowak
# Creation: 19981028
# Modification:
# Author:
# Reason:
require "proclib.pl";
require "projlib.pl";
$reportuser = &OraSlashLogin;
$Cursor = &OpenCursor($reportuser);
$CurUser = uc(substr(&cut_str($ENV{"USER"}), 0, 3 ));
$Report = "$SpoolLib/KAARBGLI";
&ExecuteReport($Cursor);
&OraSlashLogoff($reportuser,$Cursor);
system("win2mm.pl $Report");
# end
#---------------------------------------------------------------------------
# Report Format
#---------------------------------------------------------------------------
format REPORT_TOP =
KAARBGLI ARBEITSGANGLISTE
@<<<<<<<<<<<<<<<<< Seite @>>
$date, $%
---------------------------------------------------------------------------
----------------------------------
ARBGNR HGR GR UGR KURZBEZ BESCHR
P AENDDAT ID
------- --- -- --- -------------------- ------------------------------
-------------- - ---------- ---
.
format REPORT =
@###### @# @# @## @<<<<<<<<<<<<<<<<<<<
@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< @# @<<<<<<<<< @<<<
$arbgnr,$arbghgr,$arbggr,$arbgugr, $kurzbez, $beschr,
$pseudokz, $aenddat, $id
.
#---------------------------------------------------------------------------
# Subroutines
#---------------------------------------------------------------------------
sub OpenCursor {
local ($User) = @_;
($Q_ss = &ora_open($User,<<EOT)) || warn($ora_errstr);
select arbgnr, arbghgr, arbggr, arbgugr, kurzbez, beschr, pseudokz,
aenddat, id, SysDate
from arbgang
order by arbgnr, arbghgr, arbggr, arbgugr
EOT
return($Q_ss);
}
sub ExecuteReport {
local ($Cursor) = @_;
open (REPORT, "> $Report");
&SetDefaults;
while (
(
$arbgnr,
$arbghgr,
$arbggr,
$arbgugr,
$kurzbez,
$beschr,
$pseudokz,
$aenddat,
$id,
$date
) = &ora_fetch($Q_ss)) {
$aenddat =
substr($aenddat,0,4).".".substr($aenddat,4,2).".".substr($aenddat,4,2);
write REPORT;
}
close (REPORT);
&WriteReportFooter($Report);
}
sub WriteReportFooter {
local ($RF) = @_;
open (RF, ">> $RF");
print RF "\n\n\n\n --- End of Report ---\n";
close (RF);
}
sub SetDefaults {
select((select(REPORT),
$= = 66 # Seitenlänge
)[0]);
}
Franz Nowak
Mail: [EMAIL PROTECTED]
Tel: +43(0676)4115490
Private Network Solutions GmbH
www.prinetsol.com
Dr.Ludwig-Riegerstr. 7
A-2340 Mödling