utf-8 encode rss

This commit is contained in:
keyan 2022-01-07 15:29:38 -06:00
parent cb9922b373
commit 41323883a5
2 changed files with 2 additions and 2 deletions

View File

@ -31,7 +31,7 @@ const generateRssItem = (item) => {
export default function generateRssFeed (items) { export default function generateRssFeed (items) {
const itemsList = items.map(generateRssItem) 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"> <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel> <channel>
<title>${SITE_TITLE}</title> <title>${SITE_TITLE}</title>

View File

@ -17,7 +17,7 @@ export async function getServerSideProps ({ req, res }) {
if (!items || error) return emptyProps 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.write(generateRssFeed(items))
res.end() res.end()