我正在尝试从UTF-8服务器将数据导出为CSV ISO-8859-1。
我正在使用此代码,它与char“ oe”不能正常工作
const express = require('express')
const app = express()
app.get('/', function (req, res) {
const str = 'Bœuf été'
res.set('Content-Type', 'application/csv')
res.set('Content-disposition', 'attachment; filename=test.csv')
res.send(Buffer.from(str, 'latin1'))
})
app.listen(3000, function () {
console.log('listen on 3000')
})
在ISO-8859-1中,été
的口音很好,但是Bœuf
的编码不正确,我不知道自己在做什么错。
感谢您的帮助