NAME

04unicode.t - Test Unicode issues (see "The Unicode mess" in XML::XPathScript).

DESCRIPTION

We first test that is_utf8_tainted() works correctly, by comparing it's result to <Convert::Scalar/utf8> (if Convert::Scalar is available) against a set of strings whose UTF8ness is known.

Unicode and tainting

There is a fairly serious Perl bug concerning Unicode and taint bits interacting badly together, for all versions ranging from 5.6.1 to 5.8.4 (look up the history of t/op/utftaint.t in the Perl source tree). We cater for this too to some extent: we cannot prevent Perl from SEGVing, but at least is_utf8_tainted() still works and therefore an appropriate error will be raised when using XML::XPathScript->current()->binmode().

Integration with XML::XPathScript->current()->binmode()

We then proceed to testing that the UTF-8 safeguards in the stylesheet processor work correctly. They are implemented in terms of is_utf8_tainted().