Index: main/trunk/greenstone2/perllib/ghtml.pm
===================================================================
--- main/trunk/greenstone2/perllib/ghtml.pm (revision 30582)
+++ main/trunk/greenstone2/perllib/ghtml.pm (revision 30593)
@@ -219,5 +219,13 @@
}
+
if (defined $code) {
+
+ # malformed UTF-8 character used in UTF-16
+ if($code >= 0xD800 && $code <= 0xDFFF) {
+ print STDERR "Warning: encountered the HTML entity \$code; which represents part of a UTF-16 surrogate pair, which is not supported in ghtml::getcharequiv(). Replacing with '?'.\n";
+ $code = ord("?");
+ }
+
# non-standard Microsoft breakage, as usual
if ($code < 0x9f) { # code page 1252 uses reserved bytes