in reply to Re: Reading File with Czech text inside
in thread Reading File with Czech text inside

Thank u for the reply. Using get, I can read the text normally in utf8 but I want to read already downloaded file with open my $FILE .... "filename";. The script should not require connection.
  • Comment on Re^2: Reading File with Czech text inside

Replies are listed 'Best First'.
Re^3: Reading File with Czech text inside
by ikegami (Patriarch) on Mar 02, 2011 at 16:04 UTC

    If the file is encoded using iso-8859-2 (like file_iso-8859-2.txt above),

    open my $FH, "<:encoding(iso-8859-2)", 'file_iso-8859-2.txt' or die "$!\n";

    If the file is encoded using UTF-8 (like file_utf-8.txt above),

    open my $FH, "<:encoding(UTF-8)", 'file_utf-8.txt' or die "$!\n";