Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^7: UTF8 issue when getting website via LWP::UserAgent in Perl

by ultranerds (Hermit)
on May 12, 2016 at 15:46 UTC ( [id://1162876]=note: print w/replies, xml ) Need Help??


in reply to Re^6: UTF8 issue when getting website via LWP::UserAgent in Perl
in thread UTF8 issue when getting website via LWP::UserAgent in Perl

Thanks for the info. Man, this is a PITA :S Think I may have to take a break, and come back to it tomorrow.

There is definitely something up - because even using basic DBI connection, it still messes it up:

my $dsn = "DBI:mysql:database=$db_cfg->{database};host=$db_cfg->{h +ost};port=3307"; my $dbh = DBI->connect($dsn, $db_cfg->{login}, $db_cfg->{password} +); $dbh->{mysql_enable_utf8} = 1; my $sth = $dbh->prepare( "INSERT INTO ReadingGrabCache SET title = + ?" ); $sth->execute( $title ) or die $DBI::errstr;
Eugh :/

Replies are listed 'Best First'.
Re^8: UTF8 issue when getting website via LWP::UserAgent in Perl
by runrig (Abbot) on May 12, 2016 at 15:58 UTC
    Did you know you're not checking the status of the connect or the prepare? And if you turn on RaiseError in the connect, you'll automatically check all DBI methods, and you won't even need the 'or die' on the execute.
      That was just a very quick example I put together, to test the theory about how the data ended up in the table :)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2024-04-24 19:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found