'Bad UTF-8 in a path segment, query parameter, or fragment results in
that portion of the URI remaining percent-encoded in the IRI.'

def test_badUTF8AsIRI(self):

    urlWithBinary = u'http://xn--9ca.com/%00%FF/%C3%A9'
    uri = URL.fromText(urlWithBinary)
    iri = uri.asIRI()
    expectedIRI = u'http://\xe9.com/%00%FF/\xe9'
    actualIRI = iri.asText()
    self.assertEqual(actualIRI, expectedIRI, (u'%r    !=    %r' % (actualIRI, expectedIRI)))
