XPath check doesn't honor configured encoding, close #1424