I too have this problem, although with XML::Simple rather than XML::Twig. I simplified dtrusty's test case down to: - - - 8< - - - 8< - - - #!/usr/bin/perl use strict; use XML::Twig; my $twig = XML::Twig->new(twig_handlers => { x => sub { my ($twig, $x) = @_; $x->xml_text; return; # Just to point out that the return value doesn't matter. }, }); $twig->parse("ap < < << รถ"); print "XML::Twig ok\n"; - - - 8< - - - 8< - - - $ ./parse.pl Assertion rx->sublen >= (s - rx->subbeg) + i failed: file "regcomp.c", line 5098 at /usr/lib/perl5/vendor_perl/5.10.0/XML/Twig.pm line 7806. at ./parse.pl line 12 Twig.pm:7806 is: $string=~ s/([&<])/$XML::Twig::base_ent{$1}/g unless( $keep_encoding || $elt->{asis}); Versions: perl-5.10.0-56.fc10.i386 perl-XML-Twig-3.32-1.fc9.noarch (My own crash has too much code and data to easily cut down.)