Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

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 = ...;
    $sth->execute(encode_utf8($decoded));
    
  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 = ...;
    $sth->execute(_d($encoded));
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1072881]
help
Chatterbox?
[Discipulus]: create an account for him; we are funny baby sitters ;=) come here child, want to listen the typeglob tale?
[vrk]: choroba Oh, that's good.
[vrk]: Discipulus I don't know much about prime numbers, but wouldn't that kind of an answer be in a graduate-level number theory book?
[Discipulus]: my 8 yo daughter has two weeks of sleep disturbs.. we are gonna be crazy..
[Discipulus]: vrk i searched but found nothing: after this my math level if terribly low but i like to discuss my discovery with kind mathematicians

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2017-04-27 08:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (501 votes). Check out past polls.