From: Perl 5 Porters Date: Thu, 4 Jul 1996 01:50:29 +0000 (+0000) Subject: Extend to handle 8-bit characters in input X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=26fb054b40a5ca812fb2cb6fad6c77aae62c9b2f;p=p5sagit%2Fp5-mst-13.2.git Extend to handle 8-bit characters in input --- diff --git a/lib/Pod/Text.pm b/lib/Pod/Text.pm index ac4f72b..1411587 100644 --- a/lib/Pod/Text.pm +++ b/lib/Pod/Text.pm @@ -357,9 +357,8 @@ sub noremap { sub init_noremap { die "unmatched init" if $mapready++; - if ( /[\200-\377]/ ) { - warn "hit bit char in input stream"; - } + #mask off high bit characters in input stream + s/([\200-\377])/"E<".ord($1).">"/ge; } sub clear_noremap { @@ -370,13 +369,19 @@ sub clear_noremap { # otherwise the interative \w<> processing would have # been hosed by the E s { - E< - ( [A-Za-z]+ ) + E< + ( + ( \d+ ) + | ( [A-Za-z]+ ) + ) > } { do { - defined $HTML_Escapes{$1} - ? do { $HTML_Escapes{$1} } + defined $2 + ? chr($2) + : + defined $HTML_Escapes{$3} + ? do { $HTML_Escapes{$3} } : do { warn "Unknown escape: $& in $_"; "E<$1>";