wfsp has asked for the wisdom of the Perl Monks concerning the following question:
“a”
Method 1Outputsmy $encoded = encode_entities($line); print "$encoded\n";
Method 2“a”
Produces:my $text; { open my $fh, '<:utf8', 'utf8.txt'; $text = <$fh>; close $fh; } my $encoded = encode_entities($text); print "$encoded\n";
I don't believe method 1 output conforms to HTML4.01 but that method 2 does.“a”
Update:
For what it's worth the text extracted by method 2 also displays correctly in a tk text widget. :-)
Update 2:
Corrected the HTML spec.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Extracting MS Word text and encoding HTML entities
by Joost (Canon) on Mar 13, 2005 at 14:17 UTC | |
|
Re: Extracting MS Word text and encoding HTML entities
by PodMaster (Abbot) on Mar 13, 2005 at 11:18 UTC |