Re: Encoding support in DBD::File

Tim Bunce <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.dbi.sybase.devel
Message-ID <[email protected]>
On Wed, Apr 21, 2010 at 03:45:49PM +0100, Martin Evans wrote:
> H.Merijn Brand wrote:
> > This rocks!
> > 
> > my $dbh = DBI->connect ("dbi:CSV:", undef, undef, {
> >     RaiseError	=> 1,
> >     PrintError	=> 1,
> > 
> >     f_dir	=> ".",
> >     f_schema	=> undef,
> >     f_ext	=> ".csv/r",
> >     f_encoding	=> "utf8",
> >     });
> > 
> > Any objections to me committing that?
> 
> Looks good to me and I'm pleased you are using encoding and not just
> ":utf8" as the former is validating utf-8 encoding and the latter does not.

Looks good to me, but...
> 
> > +           binmode $fh, ":encoding($enc)";

I think requesting an invalid/unknown/broken encoding (where binmode
returns false) should cause an error.

Tim.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.