Re: PostgreSQL driver DBD::Pg releases version 3.0.0

Tim Bunce <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.dbi.general
Message-ID <[email protected]>
On Thu, Feb 06, 2014 at 12:30:15PM +1100, Ron Savage wrote:

> Eg: map{($_ => encode('utf-8', $$hashref{$_}) )} keys %$hashref
> $$item{$_} = decode('utf-8', $$item{$_} || '') for keys %$item

Performance tip: using the function form of encode() and decode()
is significantly slower than using the method call form:

    $utf8_encoding->decode($$item{$_} || ''):

> And each module tested under V 3.0.0 broke.
> 
> But a 1-line change fixes them:
> 
> $$attr{pg_enable_utf8}    = 0 if ($$config{dsn} =~ /dbi:Pg/i);

Sweet.

> Gotta love utf8.

:)

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.