If SP metadata contains utf-8 characters, for example letters with diacriticals, the generation of the corresponding XML file on the filesystem, fails with an error, resulting in interrupted SAML flow and, thus, blocking authentication (at least in the relatively dated systems I'm forced to use). Properly formatted Metadata XML SHOULD be utf-8, so, adding the encoding parameter to the open statement, fixes the problem.
If SP metadata contains utf-8 characters, for example letters with diacriticals, the generation of the corresponding XML file on the filesystem, fails with an error, resulting in interrupted SAML flow and, thus, blocking authentication (at least in the relatively dated systems I'm forced to use). Properly formatted Metadata XML SHOULD be utf-8, so, adding the encoding parameter to the open statement, fixes the problem.