DigitalTrustCenter / sectxt

security.txt parser and validator
European Union Public License 1.2
17 stars 6 forks source link

Request to change Parser from utf-8 to bytes #69

Closed bwbroersma closed 6 months ago

bwbroersma commented 6 months ago

Thanks for fixing:

However currently the UTF-8 and BOM check is done in the SecurityTXT class, not the Parser class, could the following code mode to the Parser class? This would of course change the Parser from accepting utf-8 to bytes. https://github.com/DigitalTrustCenter/sectxt/blob/ad85c746c82aaca882b7b3a2b8ac5a0002892e00/sectxt/__init__.py#L422-L435

Since Internet.nl uses the Parser class this would remove the need to duplicate these UTF-8 and BOM checks in Internet.nl.

DigitalTrustCenter commented 6 months ago

With the new version we changed the parser to accept bytes instead of the string and the get_str function has been moved to the parser as was requested in your comment. Now if you use the parser directly you will still see the BOM error. This is added in version 0.9.3