RE: utf8 encoding problem



The easiest way to know is to try it out. If you want to just test it
without replacing your installation's DBD::Oracle, you can do a
temporary install of a newer version of DBD::Oracle by using the
INSTALLSITELIB parameter to Makefile.PL:

wget
http://www.perl.com/CPAN/modules/by-module/DBD/DBD-Oracle-1.14.tar.gz
tar xvfz DBD-Oracle-1.14.tar.gz
cd DBD-Oracle-1.14.tar.gz
export ORACLE_HOME=/path/to/your/oracle/installation
export ORACLE_USERID=user/pass
export ORACLE_SID=your-sid
perl Makefile.PL INSTALLSITELIB=$HOME/tmp-dbd-lib
make test
make install

If the build process was successful, you'll have DBD::Oracle installed
in $HOME/tmp-dbd-lib. You can try it out using the -I parameter for
perl:

perl -I$HOME/tmp-dbd-lib your_script.pl

If it doesn't help, just "rm -rf $HOME/tmp-dbd-lib". No harm, no foul!

Regards
Philip

-----Original Message-----
From: Anand.K.S. [mailto:ks.anand80@xxxxxxxxx]
Sent: Thursday, December 21, 2006 1:18 AM
To: dbi-users@xxxxxxxx
Subject: utf8 encoding problem

Hello,

I had posted this question in CPAN forum but i was directed here for a
better answer.

Here is the problem I am facing. In the following piece of code I get a
customer name from the database and append a pound symbol to the
customer
name and update the same in the database. The NLS_LANG parameter is set
to
AMERICAN_AMERICA.WE8DEC (western European character set) When I query
the
database to see if the name has been updated correctly I see some
garbage
value appended to the name instead of just a pound symbol. Then I did
some
research to find out the version oralce DBD version being used is 1.12.
I
found some difference between 1.12 and 1.14 relating to unicode
documentation. All I want to know is whether this was a bug in 1.12
which
was fixed in the later version of 1.14 and will an upgrade to 1.14 fix
this
problem. Could anyone please confirm me on this? The closer I could get
was
to find this link http://search.cpan.org/dist/DBD-Oracle/Changes#___top.
However the work around was to use "use Encoding" (Which is commented
out in
the following code) in perl which fixed the problem.

Cheers,

Anand.



use strict;

use encoding 'utf8';

use atadb;

use vars qw($opt_u);

my $db = atadb::connect($opt_u);

my $sql = " SELECT NODE_NAME FROM CUSTOMER_NODE_HISTORY WHERE
CUSTOMER_NODE_ID = 9295370 ";

my $csr = $db->prepare($sql) || ataerr::dbprepare($db);

$csr->execute() || ataerr::dbexecute($db);

my $node_name = $csr->fetchrow; $csr->finish;

$node_name = 'wre'; my $pound = " \xc2\xa3"; print "Pound =>$pound\n";

my $node_name_upper = "\U$node_name\E".$pound; $node_name.=$pound; print
"Node name".$node_name."\n";;

print $node_name_upper."\n"; my $sql1 = "UPDATE CUSTOMER_NODE_HISTORY
SET
NODE_NAME = ? , NODE_NAME_UPPERCASE = ? WHERE CUSTOMER + +_NODE_ID =
9295370
";

my $csr1 = $db->prepare($sql1) || ataerr::dbprepare($db); print
"Executing
.... \n"; #use Encode; #$node_name = encode($ENV{PERL_ENCODING},
$node_name);
#$node_name_upper = encode($ENV{PERL_ENCODING}, $node_name_upper);

$csr1->execute($node_name, $node_name_upper) || ataerr::dbexecute($db);

print "Committing ... \n";

$db->commit || die("commit: ".$db->errstr."\n");

$csr1->finish; $db->disconnect;
.



Relevant Pages

  • utf8 encoding problem
    ... name and update the same in the database. ... AMERICAN_AMERICA.WE8DEC (western European character set) When I query the ... value appended to the name instead of just a pound symbol. ... However the work around was to use "use Encoding" (Which is commented out in ...
    (perl.dbi.users)
  • How to build a VAX/VMS emulator on Fedora Core 3 Linux
    ... make install the libpcap for ethernet support on VAX emulator ... Is the OpenVMS media ready to be mounted? ... * Do you want to install the MSGHLP database? ... Message from user AUDIT$SERVER on NEWBB ...
    (alt.os.linux.redhat)
  • Re: Need technique to programatically update back end structure / relationships
    ... Yes, that should work, Bob. ... Install the new one. ... > have the user rename the current production database (after taking a ... > final step of the installation process, I would ask the user to execute ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Error: Cannot find a valid Windows XP Embedded database installed
    ... Both the database and tools are Eval or Retail? ... Microsoft Windows XP Embedded Test Team ... Well, in fact it has a network connection, and it's working without any ... if I install everything in the same computer (tools and ...
    (microsoft.public.windowsxp.embedded)
  • Re: DBD::Informix -- Error Installing On Mac OSX
    ... the environment correctly, as long as the module reasonably clearly ... working Informix environment than to test for things that might not be ... use either the sysmaster database or the informix user to install ...
    (comp.databases.informix)