DBD::mysql and utf-8 problem
Helmut <[email protected]> Fri, 27 Jun 2008 10:41:35 +0200
| Newsgroups | gmane.comp.db.mysql.perl |
|---|---|
| Message-ID | <[email protected]> |
Hi all,
after looking for utf8 issues in this mailing list, i had the feeling,
there would be no problems concerning utf8 and the
DBD::mysql driver anymore.
However i still have a problem. The (simplified) script:
[..]
my $aeu = "\N{LATIN SMALL LETTER A WITH DIAERESIS}";
my $dbh = DBI->connect ("DBI:mysql:test:localhost;mysql_enable_utf8=1",
"test");
my $text = $dbh->selectrow_array (qq (select ?), undef, $aeu);
print qq (length $text = ), length $text, "\n";
$text = decode ("UTF-8", $text);
print qq (length decoded $text = ), length $text,"\n";
[..]
results in =>
length Ã⬠= 2
length decoded À = 1
on an iso-8859-1 console.
Questions:
Why does Perl not calculate the correct number of characters?
Does one (still) have to decode every string value received from the
DBD::mysql driver?
Thanks for any Help
Hemut
--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/[email protected]