]> git.ipfire.org Git - dbl.git/commitdiff
sources: Parse any byte-order marks
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 2 Jan 2026 13:22:05 +0000 (13:22 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 2 Jan 2026 13:22:05 +0000 (13:22 +0000)
https://en.wikipedia.org/wiki/Byte_order_mark

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/dnsbl/sources.py

index 3a41dcf4dd8c1c6c84b5e5df8b8413cb8e931f9c..e0c33eae23106245dc97b184810370387c3845d5 100644 (file)
@@ -387,7 +387,7 @@ class Source(sqlmodel.SQLModel, database.BackendMixin, table=True):
                        f = gzip.GzipFile(fileobj=f, mode="rb")
 
                # Convert into UTF-8
-               f = io.TextIOWrapper(f, encoding="utf-8")
+               f = io.TextIOWrapper(f, encoding="utf-8-sig")
 
                return f