On Thu, Dec 19, 2002 at 01:30:50PM -0000, Dominic Mitchell wrote:
> Tim Bunce wrote:
> > High bit doesn't always mean uft8 - may be latin1 etc etc.
> 
> I realise this.  Also, this utf8 flag toggling should only occur when the
> field is a text field and not any other kind of datatype.  I'm assuming
> that large objects would not be affected by this, but can you store binary
> data in a column? (Alas, I know very little about what my database can do
> :-(  )
> 
> > Is it not possible to tell (from the database api) when data is utf8? I
> > don't know PostgreSQL, but from the psql -l output above it seems that
> > the charset is a per-database issue. So maybe the database
> > charset needs to be queried and recorded at connect() time.
> 
> That's one way to do it, and could be useful.  However, it would also be
> useful if you could explicitly ask the dbh to put the driver into utf8
> mode.  The reason for this is that we have a number of postgresql
> databases which are set up as SQL_ASCII, even though we've stored UTF8 in
> them.  This has worked ok under previous perl's because they just tended
> to output the bytes that they were given.

Maybe drivers could use something like

        $sth->bind_col( 1, \$foo, { CharSet => ... } );

to indicate that a column is UTF8.

> > (I think this is also going to be a big issue in MySQL 4.1, which
> > can have different charsets in different fields of the same table...)
> 
> Eeek.  I assumed that charset would only be a per database thing after
> looking at postgres...

Life is rarely that simple...

Tim.

Reply via email to