Fix #73246: XMLReader: encoding length not checked libxml2 expects the passed encoding to be NUL terminated, so we reject strings with NUL bytes right away. Closes GH-6899.