Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re: DBD::Pg encodes Perlstring to UTF-8 bytes instead of WIN1252 regardless client encoding

by ikegami (Pope)
on Jan 31, 2014 at 17:17 UTC ( #1072881=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download

  1. or download this
    use Encode qw( is_utf8 encode_utf8 );
    is_utf8($string) ? encode_utf8($string) : $string
  2. or download this
    use Encode qw( encode_utf8 );
    my $sth = ...;
  3. or download this
    use Encode qw( decode );
    my $sth = ...;
    $sth->execute(decode('cp1252', $encoded));
  4. or download this
    sub _d { my ($s) = @_; utf8::downgrade($_); $s }
    my $sth = ...;

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1072881]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (10)
As of 2015-11-30 09:46 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (769 votes), past polls