[Dbix-class] DBIC to DBD::Oracle UTF-8 placeholder checks
peter at dragonstaff.com
peter at dragonstaff.com
Mon Oct 27 14:50:20 GMT 2008
I've a question about the best way to interpose in checking the
arguments passed from DBIC via DBI to DBD::Oracle::execute().
From DBD::Oracle docs
http://search.cpan.org/~pythian/DBD-Oracle-1.22/Oracle.pm#DBD::Oracle_and_Unicode
there's a strange situation.
Data fetched is always returned as UTF-8 marked Perl variables.
When sending data using placeholders, however, if you use Perl
internal byte encoded format variables containing wide characters you
can get broken (double encoded) results on re-retrieving.
Ideally, I'd like to catch the check all the arguments that end up
passed to execute() and either throw an exception on non UTF-8 marked
vars with wide characters or call decode('iso-8859-1', $var) on each
one first.
This is so I can replicate the behaviour of the BBC's internal caching
db library.
I had a look at lib/DBIx/Class/Storage/DBI.pm and DBI/Oracle.pm but
couldn't see any easy way to do this.
Any suggestions on the best way to do this?
Thanks, Peter
http://perl.dragonstaff.co.uk
More information about the DBIx-Class
mailing list