remove bom

This commit is contained in:
Nazar Kanaev
2021-04-07 10:25:30 +01:00
parent 42b36965c5
commit fbb0dfed47
3 changed files with 17 additions and 0 deletions

View File

@@ -17,6 +17,7 @@ type processor func(r io.Reader) (*Feed, error)
func sniff(lookup string) (string, processor) {
lookup = strings.TrimSpace(lookup)
lookup = strings.TrimLeft(lookup, "\x00\xEF\xBB\xBF\xFE\xFF")
switch lookup[0] {
case '<':
decoder := xmlDecoder(strings.NewReader(lookup))