Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions feedparser/encodings.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,10 @@ def convert_to_utf8(
elif data[:4] == UTF32LE_MARKER:
bom_encoding = "utf-32le"

# Strip leading ASCII whitespace to handle broken feeds that start
# with a newline before the XML declaration (gh#508).
data = data.lstrip()

tempdata = data
try:
if bom_encoding:
Expand Down