DBD-Firebird
view release on metacpan or search on metacpan
t/75-utf8.t view on Meta::CPAN
ok( $dbh->do(
"INSERT INTO $table VALUES(3, 'VærÑà r', 'Tæst', 'â¬Ã·â')")
);
ok( $cursor->execute(3) );
$row = $cursor->fetchrow_arrayref;
$cursor->finish;
is( $row->[0], 3 );
is( $row->[1], 'VærÑà r' );
is( $row->[2], 'Tæst' );
is( $row->[3], 'â¬Ã·â', 'inline unicode blob' );
#
# Insert UTF8, binding
#
ok( $dbh->do(
"INSERT INTO $table VALUES(4, ?, ?, ?)",
{}, 'VærÑà r', 'Tæst', 'â¬Ã·â'
)
);
ok( $cursor->execute(4) );
$row = $cursor->fetchrow_arrayref;
$cursor->finish;
is( $row->[0], 4 );
is( $row->[1], 'VærÑà r' );
is( $row->[2], 'Tæst' );
is( $row->[3], 'â¬Ã·â', 'bound unicode blob' );
#
# Now turn off unicode support. things we fetch should not be flagged as
# unicode anymore
#
$dbh->{ib_enable_utf8} = 0;
ok( !$dbh->{ib_enable_utf8}, 'Turn off ib_enable_utf8' );
ok( $cursor->execute(4) );
$row = $cursor->fetchrow_arrayref;
$cursor->finish;
is( $row->[0], 4 );
is( $row->[1], encode_utf8('VærÑà r'), 'non-unicode varchar' );
is( $row->[2], encode_utf8('Tæst'), 'non-unicode char' );
is( $row->[3], encode_utf8('â¬Ã·â'), 'non-unicode blob' );
#
# ... and drop it.
#
ok($dbh->do("DROP TABLE $table"), "DROP TABLE '$table'");
#
# Finally disconnect.
#
ok($dbh->disconnect());
( run in 0.337 second using v1.01-cache-2.11-cpan-88abd93f124 )