print "1..2\n"; use strict; use HTML::Parser (); my $dtext = ""; my $text = ""; sub append { $dtext .= shift; $text .= shift; } my $p = HTML::Parser->new(text_h => [\&append, "dtext, text"], default_h => [\&append, "text, text" ], ); my $doc = <<'EOT'; <a href="fooå">ååAA<A>AA</a> <?å> &xyzzy &xyzzy; <!-- � -->  ÿ <!-- Ā --> � � & <xmp>å</xmp> <script>å</script> <ScRIPT>å</scRIPT> <skript>å</script> EOT $p->parse($doc)->eof; print "not " unless $text eq $doc; print "ok 1\n"; print $dtext; print "not " unless $dtext eq <<"EOT"; print "ok 2\n"; <a href="fooå">ċċAA<A>AA</a> <?å> &xyzzy &xyzzy; <!-- � --> \1 \377 <!-- Ā --> � � & <xmp>å</xmp> <script>å</script> <ScRIPT>å</scRIPT> <skript>ċ</script> EOT