HTML::Parser 3.40/3.41 and UTF8 on perl 5.8.0
am 02.12.2004 00:17:12 von Russell.ReedThe sv_catpvn_utf8_upgrade macro used in hparser.c in versions 3.40 and 3.41
of HTML::Parser doesn't seem to exist in Perl 5.8.0. Can the macro be
replaced, so that the module is compatible with this version of Perl?
Following is a patch to do what I'm requesting, in unified diff format.
Russell Reed
Russell.Reed[at]acxiom.com
--- hparser.c 2004-11-29 07:35:58.000000000 -0600
+++ hparser.c.new 2004-12-01 17:13:08.000000000 -0600
@@ -301,7 +301,13 @@
}
else {
SV *tmp = NULL;
+/* Not defined in Perl 5.8.0
sv_catpvn_utf8_upgrade(p_state->pend_text, beg, end -
beg, tmp);
+*/
+ tmp = sv_2mortal(newSVpvn(beg, end - beg));
+ SvUTF8_off(tmp);
+ sv_utf8_upgrade(tmp);
+ sv_catsv(p_state->pend_text, tmp);
}
#else
sv_catpvn(p_state->pend_text, beg, end - beg);
@@ -640,7 +646,13 @@
}
else {
SV *tmp = NULL;
+/* Not defined in Perl 5.8.0
sv_catpvn_utf8_upgrade(p_state->skipped_text, beg, end -
beg, tmp);
+*/
+ tmp = sv_2mortal(newSVpvn(beg, end - beg));
+ SvUTF8_off(tmp);
+ sv_utf8_upgrade(tmp);
+ sv_catsv(p_state->skipped_text, tmp);
}
#endif
}
************************************************************ **********
The information contained in this communication is
confidential, is intended only for the use of the recipient
named above, and may be legally privileged.
If the reader of this message is not the intended
recipient, you are hereby notified that any dissemination,
distribution, or copying of this communication is strictly
prohibited.
If you have received this communication in error,
please re-send this communication to the sender and
delete the original message or any copy of it from your
computer system. Thank You.