In this line, the Saml2MetadataFilter sends out the response without specifying an encoding. The response will therefore be encoded using the default ISO-8859-1 encoding (see getWriter Javadoc).
However, the xml file itself starts with <?xml version="1.0" encoding="UTF-8"?>.
This results in a broken file when using OpenSamlMetadataResolver.setEntityDescriptorCustomizer to add a <md:ServiceDescription> element containing special characters like German umlauts (äöü).