perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adam Prime x443" <apr...@brunico.com>
Subject RE: Special characters
Date Tue, 21 Aug 2007 19:01:28 GMT
You've said that you've verified that the data is in the DB correctly from the shell, but it's
possible that it's trying to convert to another charset it when you pull it out for some reason.
 There seems to be some stuff in the DBD::Oracle documentation talking about charsets and
unicode, i'd start by looking there.

http://search.cpan.org/~pythian/DBD-Oracle-1.19/Oracle.pm#DBD::Oracle_and_Unicode

HTH,
Adam

________________________________

From: Dan King [mailto:DKing@carms.ca] 
Sent: Tuesday, August 21, 2007 2:22 PM
To: modperl@perl.apache.org
Subject: Special characters



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 both on Solaris 9. The reason I am asking the question
here is I am wondering if mod perl does any conversion of text that is typed into a text box.


 

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.

 


Mime
View raw message