in reply to Re: write html code with perl
in thread write html code with perl
Hi Ken. Regarding your closing remark about character entities for the non-ASCII characters, I think one rule will suffice: use HTML::Entities. It has an "encode_entities" function that can convert utf-8 characters in a given range to their "symbolic" entity-references:
perl -MHTML::Entities=encode_entities -e 'print encode_entities("\x{00 +bf}Que?")'
(Update: to clarify: if the files to be listed already have quaint names with non-ASCII utf8 characters in them, then adding HTML::Entities::encode_entities will make sure those names will display correctly without having to worry about a given browser's default character-set; but if the string descriptions to be displayed are different from the actual file names used, then there would need to be some sort of look-up table for that.)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: write html code with perl
by kcott (Archbishop) on Mar 01, 2014 at 18:32 UTC |
In Section
Seekers of Perl Wisdom