/[A3C]/lib/A3C/SQL.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /lib/A3C/SQL.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 162 by dpavlin, Sun Jun 15 17:47:39 2008 UTC revision 218 by dpavlin, Sat Jun 21 11:01:35 2008 UTC
# Line 31  specify it like this: Line 31  specify it like this:
31          encoding => 'UTF-8',          encoding => 'UTF-8',
32    });    });
33    
34    Mungling with C<encoding> is rearly needed, especially if using recent C<DBD::Pg> as driver.
35    
36  =head2 sth  =head2 sth
37    
38  Execute query and return statement handle. Ususally you don't have to call this manually.  Execute query and return statement handle. Ususally you don't have to call this manually.
# Line 117  sub AUTOLOAD { Line 119  sub AUTOLOAD {
119          my $type = ref($self) or die "$self is not an object";          my $type = ref($self) or die "$self is not an object";
120          my $name = $AUTOLOAD;          my $name = $AUTOLOAD;
121          $name =~ s/.*://;          $name =~ s/.*://;
122          Jifty->log->error("SQL: $name doesn't exist") unless defined($self->{$name});          my $v = $self->{$name};
123          return decode( $self->{__encoding}, $self->{$name} );          Jifty->log->error("SQL: $name doesn't exist") unless defined $v;
124            if ( ! Encode::is_utf8( $v ) ) {
125                    eval { $v = decode( $self->{__encoding}, $self->{$name} ) };
126                    if ( $@ ) {
127                            warn "## column $name can't decode ",dump( $self->{$name} );
128                            $v = $self->{$name};
129                    }
130            }
131            return $v;
132  }  }
133    
134  sub DESTROY {}  sub DESTROY {}

Legend:
Removed from v.162  
changed lines
  Added in v.218

  ViewVC Help
Powered by ViewVC 1.1.26