From: Perl 5 Porters Date: Thu, 4 Jul 1996 01:50:18 +0000 (+0000) Subject: Handle characters with high bit set X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=18b0293d6bd44580fa162d92218c33f9d9672066;p=p5sagit%2Fp5-mst-13.2.git Handle characters with high bit set --- diff --git a/pod/pod2latex.PL b/pod/pod2latex.PL index 34b1faa..602364e 100644 --- a/pod/pod2latex.PL +++ b/pod/pod2latex.PL @@ -500,9 +500,8 @@ sub noremap { } sub init_noremap { - if ( /[\200-\377]/ ) { - warn "hit bit char in input stream"; - } + # escape high bit characters in input stream + s/([\200-\377])/"E<".ord($1).">"/ge; } sub clear_noremap { @@ -513,11 +512,14 @@ sub clear_noremap { sub expand_HTML_escapes { local($s) = $_[0]; - $s =~ s { E<([A-Za-z]+)> } + $s =~ s { E<((\d+)|([A-Za-z]+))> } { do { - exists $HTML_Escapes{$1} - ? do { $HTML_Escapes{$1} } + defined($2) + ? do { chr($2) } + : + exists $HTML_Escapes{$3} + ? do { $HTML_Escapes{$3} } : do { warn "Unknown escape: $& in $_"; "E<$1>";