Make encoding variable
This commit is contained in:
		
							
								
								
									
										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 | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user