Make encoding variable
This commit is contained in:
parent
ba1b797b0f
commit
edd8a49e8f
4
rss.go
4
rss.go
@ -229,7 +229,7 @@ func NewFeed() *Feed {
|
||||
}
|
||||
}
|
||||
|
||||
func (f *Feed) ToXML() (string, error) {
|
||||
func (f *Feed) ToXML(encoding string) (string, error) {
|
||||
if err := f.check(); err != nil {
|
||||
return "", fmt.Errorf("error checking RSS feed: %v", err)
|
||||
}
|
||||
@ -239,5 +239,5 @@ func (f *Feed) ToXML() (string, error) {
|
||||
return "", fmt.Errorf("error XML encoding feed: %v", err)
|
||||
}
|
||||
|
||||
return `<?xml version="1.0" encoding="UTF-8"?>` + string(xml), nil
|
||||
return `<?xml version="1.0" encoding="` + encoding + `"?>` + string(xml), nil
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user