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. 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 CountZero (Bishop) on Mar 02, 2011 at 15:19 UTC
    No problem. I downloaded the text, copied and pasted it into Notepad and saved it as UTF-8 text.

    The following program reads it without any problem:

    use Modern::Perl; use IO::All; my $text < io('./czech-test.txt'); say $text;
    And yes, IO::All is that simple, it takes care of all the low-level details and doesn't care if the source or destination of your operation is a file, an FTP server, HTTP(s), a socket, a pipe, a scalar variable, a database, ...

    It just Does the Right Thing.

    CountZero

    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James