RE: Special characters




Oracle's IAS globalization guide is pretty helpful in understanding the interplay of Oracle, Perl and the web environment:
http://www.oracle.com/technology/tech/globalization/pdf/globalization-best-practices.PDF

It was written for 9i, but most of it still applies to 10g, I believe.

- Philip


Dan King wrote:
I am having issues running a web application, called OTRS, that uses
DBI and DBD::Oracle. When I insert special characters, such as é or â
they show up as question marks in the database when looking at them
from sqlplus or through the web application. I am running the web app
on Apache v1 with an Oracle 10g backend.



I have been able to successfully insert and read the special
characters using sqlplus from the command line of the server running
the web app, apache and Oracle as well as creating a small perl test
script that looks as follows:



#!/usr/local/bin/perl

use warnings;

use strict;

use Data::Dumper;

use DBI;

use DBD::Oracle;



my $dbh = DBI->connect("dbi:Oracle:host=localhost;sid=QAT",
"rm_ticket", "rm_ticket");

my $sql = qq{ UPDATE signature SET text='çè' WHERE id=1 };

my $sth = $dbh->prepare($sql);

$sth->execute();

$sth->finish();

$dbh->disconnect;



The reading script looks as follows:



#!/usr/local/bin/perl

use warnings;

use strict;

use Data::Dumper;

use DBI;

use DBD::Oracle;



my $dbh = DBI->connect("dbi:Oracle:host=localhost;sid=QAT",
"rm_ticket", "rm_ticket");

my $sql = qq{ SELECT text from signature };

my $sth = $dbh->prepare($sql);

$sth->execute();

my($text);

$sth->bind_columns(undef, \$text);

print "Text of signature:\n\n";

while( $sth->fetch() ) {

print "Object: $text\n";

}

$sth->finish();

$dbh->disconnect;



Does anyone know why I can successfully write and read from the
database when I am not using the web application but when I use the
web application the special characters fail to work properly?

Dan King
Software Developer
Canadian Resident Matching Service
613.237.0075 ext. 241
(Toll free) 877.CARMS.42
171 Nepean Street, Suite 300
Ottawa, ON, CAN K2P 0B4
www.carms.ca <http://www.carms.ca>

------------------------------------------------------------------------------------

This e-mail message, including any attachments, is for the sole use
of the intended recipients and may contain confidential and or
privileged information. If you are not the intended recipient or
this information has been forwarded in error, please contact the
sender by reply e-mail and destroy copies of the original message.
Ce message (incluant toute pièce jointe) s'adresse uniquement au(x)
destinataire(s) prévu(s) ou à une personne autorisée à le recevoir en
son (leur) nom. Il pourrait contenir des renseignements confidentiels
ou protégés. Si vous l'avez reçu par erreur, nous vous prions d'en
informer l'auteur dans les meilleurs délais, de ne pas divulguer son
contenu et de le supprimer de votre système. Merci.

.



Relevant Pages

  • Re: ANNOUNCE: DBD:Oracle 1.18
    ... Well a warning in one compiler is better than and error in an other so I ... This might be a problem more with the older oracle OCI in your client. ... perl -Mblib t/26exe_array.t ...
    (perl.dbi.users)
  • Re: float bug? perl 5.8, DBI and oracle 10.2.0
    ... If you want to store high precision numbers in oracle, you've got 38 decimal digits to play with, and with minimal coaxing perl will handle them as strings at the appropriate points so that the exact values go in and come out. ... I haven't done any numerical work in 10 years or so, but I seem to recall that one can reasonably expect 6 or so decimal significant digits from a 32 bit floating point number - I'll go out on a limb and hazard that one can expect 12 or so digits from a 64 bit floating point number - at any rate I'd be very surprised to get 18 significant digits. ...
    (perl.dbi.users)
  • RE: Memory fault(coredump) with two DBD type connections
    ... I get a core dump ... all the libraries are the same threaded model(single threaded perl uses ... I am running Perl 5.8.8 with DBD-Oracle 1.19 compiled against Oracle ... when I try to connect to the same Oracle database AND same DB2 database ...
    (perl.dbi.users)
  • Re: Is perl better? :(((
    ... >> Wasthe original PERL script hitting an Oracle database? ... >> Did you run an explain plan on your Oracle SQL? ... Java and perl on another. ...
    (comp.lang.java.databases)
  • Re: Is perl better? :(((
    ... >> Wasthe original PERL script hitting an Oracle database? ... >> Did you run an explain plan on your Oracle SQL? ... Java and perl on another. ...
    (comp.lang.java.programmer)