You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I get gibberish on my console when running the following, with or without binmode'ing STDERR:
use LWP::UserAgent;
use LWP::ConsoleLogger::Easy qw( debug_ua );
# gibberish with or without it
#binmode STDERR, ':encoding(UTF-8)';
my $ua = LWP::UserAgent->new();
my $logger = debug_ua($ua, 5);
# greek content
#my $res = $ua->get('https://tvxs.gr');
my $res = $ua->get('https://www.greekfontsociety-gfs.gr/about');
What works for me (well ok I get question-marks for a few characters) is to tell $logger to use a new Log::Dispatch with the utf8 flag turned off, as follows:
use LWP::UserAgent;
use LWP::ConsoleLogger::Easy qw( debug_ua );
use Log::Dispatch;
my $ua = LWP::UserAgent->new();
my $logger = debug_ua($ua, 5);
$logger->logger(Log::Dispatch->new(
outputs => [
[ 'Screen', min_level => 'debug', newline => 1, utf8 => 0, ],
],
));
# greek content
#my $res = $ua->get('https://tvxs.gr');
my $res = $ua->get('https://www.greekfontsociety-gfs.gr/about');
Is there a simpler way to display the unicode content correctly?
Or can you allow controlling utf8 via LWP::ConsoleLogger::Easy?