1 # UTF8DBI.pm re-implementation by Pavel Kudinov http://search.cpan.org/~kudinov/
2 # originally from: http://dysphoria.net/code/perl-utf8/
3 # And patched again by Andrew Forrest, Jan 2007
9 package UTF8DBI
; use base DBI
;
11 if (ref $_ eq 'ARRAY') {_utf8_
() foreach @
$_ }
12 elsif (ref $_ eq 'HASH' ) {_utf8_
() foreach values %$_ }
15 $_ = '⁂malformed-UTF8‼' #die "Malformed utf8 string in database"
16 if (Encode
::is_utf8
($_) && ! Encode
::is_utf8
($_, 1));
22 package UTF8DBI
::db
; use base DBI
::db
;
24 sub selectrow_arrayref
{ return UTF8DBI
::_utf8_
for shift->SUPER::selectrow_arrayref
(@_) };
25 sub selectrow_hashref
{ return UTF8DBI
::_utf8_
for shift->SUPER::selectrow_hashref
(@_) };
26 sub selectall_arrayref
{ return UTF8DBI
::_utf8_
for shift->SUPER::selectall_arrayref
(@_) };
27 sub selectall_hashref
{ return UTF8DBI
::_utf8_
for shift->SUPER::selectall_hashref
(@_) };
28 sub selectcol_arrayref
{ return UTF8DBI
::_utf8_
for shift->SUPER::selectcol_arrayref
(@_) };
30 sub selectrow_array
{ @
{shift->selectrow_arrayref(@_)} };
33 package UTF8DBI
::st
; use base DBI
::st
;
35 sub fetch
{ return UTF8DBI
::_utf8_
for shift->SUPER::fetch
(@_) };