develooper Front page | perl.dbi.users | Postings from March 2005

Confused: DBI, MySQL and utf8

From:
Bas Schulte
Date:
March 31, 2005 01:23
Subject:
Confused: DBI, MySQL and utf8
Message ID:
8F564849-A1C6-11D9-B447-000A9591400C@zeelandnet.nl
Hi all,

I know I'm not the first one who's asked about this but I fail to see 
the light on this topic (that's what you get when brought up in a 
west-european country: all your really understand is ascii).

I'm working on making a fairly large system fully utf8: stuff all texts 
in utf8 tables (MySQL 4.1.1, using "charset=utf8"), validate all 
possible inputs (things like binmode(STDIN, ":utf8"); etc.), making 
sure all strings that are utf8 have the utf8 flag set etc..

However, when retrieving this carefully inserted utf8 text data from 
our db using DBI/DBD::mysql (DBD-mysql-2.9004), the data does not have 
the utf8 flag is (Encode::is_utf8 returns false on those strings).

Is it really necessary to decode_utf8(...) *all* textual data we get 
from DBI/DBD::mysql? Even though the source (MySQL/DBD::mysql) knows 
the data is utf8?

BTW: perl is 5.8.6

Sorry for rehashing the issue, I've read a lot on it, but I just can't 
seem to see the final solution ;(

Regards,

Bas.




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About