I have script for reading html files in Perl, it works, but it breaks encoding.
This is my script:
use utf8;
use Data::Dumper;
open my $fr, '<', 'file.html' or die "Can't open file $!";
my $content_from_file = do { local $/; <$fr> };
print Dumper($content_from_file);
Content of file.html:
<span class="previews-counter">Počet hodnotení: [%product.rating_votes%]</span>
<a href="#" title="[%L10n.msg('Zobraziť recenzie')%]" class="previews-btn js-previews-btn">[%L10n.msg('Zobraziť recenzie')%]</a>
Output from reading:
<span class=\"previews-counter\">Po\x{10d}et hodnoten\x{ed}: [%product.rating_votes%]</span>
<a href=\"#\" title=\"[%L10n.msg('Zobrazi\x{165} recenzie')%]\" class=\"previews-btn js-previews-btn\">[%L10n.msg('Zobrazi\x{165} recenzie')%]</a>
As you can see lot of characters are escaped, how can I read this file and show content of it as it is?