Alexander Farber wrote:
And here is my test case, the last printed line shows my problem:
http://pastebin.com/f6fc68309
$ cat dbi-utf.pl
#!/usr/bin/perl -w
use strict;
use utf8;
use DBI qw(:utils);
use Encode qw(encode_utf8 decode_utf8);
use constant HEARTS_HTML => pack ' U', 0x2665;
Why do you use this strange notation?
use constant HEARTS_HTML => "\x{2665}" should work at least as good,
without needing to work through pack().
use constant X => 'phpbb';
my ($dbh, $ins1, $ins2, $sel1, $sel2, $href, $str1, $str2);
$dbh = DBI->connect('dbi:Pg:dbname=' . X, X, X, { RaiseError => 1});
I'm missing |pg_enable_utf8 => 1 here, right after RaiseError => 1.
Try running the tests
http://cpansearch.perl.org/src/MJEVANS/DBD-ODBC-1.18/t/40UnicodeRoundTrip.t
and http://cpansearch.perl.org/src/MJEVANS/DBD-ODBC-1.18/t/41Unicode.t
and you should see what is happening to your data.
Alexander
|
--
Alexander Foken
mailto:[email protected] http://www.foken.de/alexander/