in reply to Problem with utf8 after nearly 4096 bytes
I'm not sure if I understood your advice, but I changed this:
undef $/; my $text = <$fh>;
For this:
while(<$fh>){ $text .= <$fh>; }
But I still get the same result. Is that what you mean by read the file line by line? When I did this kind of read on "pure Perl" I used:
open FL, "<"."file.txt"; binmode(FL, ":utf8");
And it worked fine, but now I'm sending the file from a html page(<input type="file"...) so I don't know any other way to get the file handle besides that. Thanks for the help and sorry about the stupidity, I'm just a beginner on perl programming.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Problem with utf8 after nearly 4096 bytes
by McA (Priest) on Sep 02, 2013 at 07:34 UTC | |
|
Re^2: Problem with utf8 after nearly 4096 bytes
by Anonymous Monk on Sep 02, 2013 at 08:00 UTC | |
|
Re^2: Problem with utf8 after nearly 4096 bytes
by Random_Walk (Prior) on Sep 02, 2013 at 09:59 UTC |