Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I have set my console to display unicode but I get Mojibake for certain websites. The website that is commented out displays fine in my console window but not the other website. How can I get $html to store unicode for all websites?use strict; use warnings; use charnames qw(:full); use LWP::Simple; use HTML::Strip; use Encode::Encoder qw(encoder); binmode STDOUT, ":encoding(UTF-8)"; my $url = "http://www.svd.se/nyheter/utrikes/spricka-mellan-u-lander-o +roar_3926455.svd"; #my $url = "http://www.expressen.se"; my $html = get($url); defined $html or die "Can't fetch HTML from: ",$url; my $hs = HTML::Strip->new(); my $clean_text = $hs->parse( $html ); print $clean_text;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Problem displaying unicode for certain websites
by ikegami (Patriarch) on Dec 12, 2009 at 10:09 UTC | |
by ikegami (Patriarch) on Dec 12, 2009 at 10:51 UTC | |
by Anonymous Monk on Dec 12, 2009 at 10:54 UTC | |
by ikegami (Patriarch) on Dec 12, 2009 at 11:10 UTC | |
by Anonymous Monk on Dec 12, 2009 at 11:14 UTC | |
by Anonymous Monk on Dec 12, 2009 at 11:25 UTC | |
| |
by Anonymous Monk on Dec 12, 2009 at 10:58 UTC | |
by Anonymous Monk on Dec 12, 2009 at 11:01 UTC |