in reply to Downloading webpages with non-ASCII characters

LWP::UserAgent did't do anything with encoding...

In my script

use strict; use LWP::UserAgent; my @captions; my $ua = LWP::UserAgent->new(); my $response = $ua->get('http://www.1418.ru/chronicles.php?p=100'); if ($response->is_success) { my $file = $response->content; $file =~ m/<h3>(.*)<\/h3>/i; my $h3_content = $1; push @captions, $h3_content; } else { warn 'ERROR: no HTML ',$response->status_line; } open TEST, ">", "test.txt" or die $!; print TEST $captions[0]; close TEST;

I get txt file with normal cp1251 text.

So the question is how do you open resulting file?