utf-8 encode rss
This commit is contained in:
parent
cb9922b373
commit
41323883a5
|
@ -31,7 +31,7 @@ const generateRssItem = (item) => {
|
|||
|
||||
export default function generateRssFeed (items) {
|
||||
const itemsList = items.map(generateRssItem)
|
||||
return `
|
||||
return `<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
<channel>
|
||||
<title>${SITE_TITLE}</title>
|
||||
|
|
|
@ -17,7 +17,7 @@ export async function getServerSideProps ({ req, res }) {
|
|||
|
||||
if (!items || error) return emptyProps
|
||||
|
||||
res.setHeader('Content-Type', 'text/xml')
|
||||
res.setHeader('Content-Type', 'text/xml; charset=utf-8')
|
||||
res.write(generateRssFeed(items))
|
||||
res.end()
|
||||
|
||||
|
|
Loading…
Reference in New Issue