in reply to Reading File with Czech text inside
The second snippet without a temp file:
use Encode qw( decode ); my $url = "http://ufal.mff.cuni.cz/~hajic/courses/npfl067/TEXTCZ1.txt" +; my $content = decode('iso-8859-2', get($url));
If you also want to write to the files,
{ open my $FH, ">:encoding(iso-8859-2)", 'file_iso-8859-2.txt' or die "$!\n"; print $FH $content; } { open my $FH, ">:encoding(utf-8)", 'file_utf-8.txt' or die "$!\n"; print $FH $content; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Reading File with Czech text inside
by fibokowalsky (Initiate) on Mar 02, 2011 at 14:07 UTC | |
by ikegami (Patriarch) on Mar 02, 2011 at 16:04 UTC |