Subject: | Patch for Decode::Numeric |
Similar to the patch for XHTML. I found that mixing the entity and
numeric chars would cause problems in output. Applying this patch
resolves those issues.
Subject: | Numeric.pm.diff |
--- Numeric.pm 2003-12-10 10:52:13.000000000 -0500
+++ /home/william/work/perl/Knowmad-Mailform/perl5/MKDoc/XML/Decode/Numeric.pm 2007-02-27 02:40:13.000000000 -0500
@@ -1,6 +1,7 @@
package MKDoc::XML::Decode::Numeric;
use warnings;
use strict;
+use Encode;
sub process
{
@@ -13,9 +14,14 @@
# if hex, convert to hex
$stuff =~ s/^\[xX]([0-9a-fA-F])+$/hex($1)/e;
-
return unless ($stuff =~ /^\d+$/);
- return chr ($stuff);
+
+
+ # Encode
+ my $chr = chr($stuff);
+ $chr = Encode::encode_utf8($chr);
+ $chr = pack("U*", unpack("C*", $chr));
+ return $chr;
}
1;