in reply to Re^5: HTML::Parser, file, print to Terminal
in thread HTML::Parser, file, print to Terminal
Okay, this DOES work...
#!/usr/bin/perl -w # legaget.pl use strict; use Encode; my $filename = "engleword.html"; open FILE, "<", $filename or die $1; while( my $line = <FILE> ) { print encode( "utf8",$line); } close(FILE);
What I have learned...
I have come across this encode problem as a graphic artist. Customers used MSWord to generate text and then pasted the resulting text into html, or Adobe Pagemaker, PDF, etc. and everything is just hunky-dory on a WinBox, but on a Mac or Linux the results had missing characters. MS was late adopting Unicode. MS thought they had another answer with OpenType (I think it was) a fonts technology in partnership with Adobe. That fell apart. But in pre-XP MS text products the first byte set the encode for the text file. I used to have a FreeWare program on the PC that manually changed that byte.
Forgive me, I worked on this silly problem all day, but I'm loving Perl.
|
|---|