Tim Bunce <[EMAIL PROTECTED]> wrote:
> [Moved to dbi-dev]
> On Wed, Sep 10, 2003 at 03:46:20PM +0100, Steve Hay wrote:
>> Tim Bunce wrote:
>> >For people stuck with older versions of mysql, a driver private
>> >option could be used to indicate that all char fields are utf8,
>> >or have some way of indicating that per-column, such as
>> >
>> >    $sth->bind_col(1, undef, { mysql_charset => 'utf8' });
>>
>> OK, I'll pass this suggestion on to the DBD-mysql maintainer(s).
> 
> Actually, something like    ..., { mysql_is_utf8 => 1 });
> would be simpler

I added support for this in a per-database fashion for DBD::Pg.  You
might wish to look there to get a starting point.  Search for SvUTF8_off
in dbdimp.[ch].

Basically, I just added a flag that when set gets the driver to check
each piece of returned data (that looks like it came from a character
type of field) for something that looks like UTF-8.

It's not ideal, but it does let you do useful things with UTF-8 under
perl-5.8.0.  Otherwise you have to find every piece of code that returns
data from the database and call decode_utf8() over it.

-Dom

-- 
| Semantico: creators of major online resources          |
|       URL: http://www.semantico.com/                   |
|       Tel: +44 (1273) 722222                           |
|   Address: 33 Bond St., Brighton, Sussex, BN1 1RD, UK. |

Reply via email to