foomatic/foomatic-bad-utf8.patch

25 lines
603 B
Diff
Raw Normal View History

2004-11-24 09:39:47 +00:00
--- foomatic-db-engine-3.0.2/lib/Foomatic/PPD.pm.bad-utf8 2002-10-11 02:16:34.000000000 +0100
+++ foomatic-db-engine-3.0.2/lib/Foomatic/PPD.pm 2004-11-23 19:32:26.000000000 +0000
@@ -300,11 +300,17 @@
sub xml_esc {
my ($in) = (@_);
- $in =~ s!&!&!g;
- $in =~ s!<!&lt;!g;
- $in =~ s!>!&gt;!g;
+ @chars = split(//,$in);
+ $ascii = "";
+ foreach (@chars) {
+ if (ord ($_) > 127) { $_="?"; }
+ $ascii .= $_;
+ }
+ $ascii =~ s!&!&amp;!g;
+ $ascii =~ s!<!&lt;!g;
+ $ascii =~ s!>!&gt;!g;
- return $in;
+ return $ascii;
}
sub pdq_filter {