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

Sorry, that was a mistake :) This is what I have:
print "GOT TITLE BEFORE: $title \n<Br><Br>"; $DB->table("ReadingGrabCache")->add( { title => $title, url => + "Foo" }); my $test = $DB->table("ReadingGrabCache")->select ( { url => " +Foo" })->fetchrow_hashref; print "BEFORE RE-ENCODING: $test->{title} \n<br>"; $test->{title} = decode("utf-8",$test->{title}); print "AFTER RE-ENCODING: $test->{title} \n<br>";
GOT TITLE BEFORE: Румыния не будет участвовать в Евровидении-2016 из-за денег - Газета.Ru

BEFORE RE-ENCODING: (ie right out of the DB grab) ƒм‹ния не бƒде‚ ƒ‡ас‚вова‚Œ в «•в€овидении-2016» из-за денег - “азе‚а.Ru
AFTER RE-ENCODING: Румыния не будет участвовать в Евровидении-2016 из-за денег - Газета.Ru

Replies are listed 'Best First'.
Re^8: UTF8 issue when getting website via LWP::UserAgent in Perl
by Anonymous Monk on May 12, 2016 at 15:37 UTC
    that's because you binmoded STDOUT... here's a simpler way to show the problem:

    perl -E'binmode STDOUT, ":utf8"; say "Румыния";'

      Ah you little beauty - that did it! It still shows up buggered in phpmyadmin:

      view here

      ...but when going in/out of the DB, it now seems to output it correctly :) The weird thing, is that if I look at the data from that table using the CMS's own admin panel (where you can view the data) ... then it looks fine! It just seems to be phpmyadmin that has it confused now.

      Thanks :)

      Andy
        It just seems to be phpmyadmin that has it confused now.

        Yet another reason (if one were needed) to avoid that particular "utility".