1、中文乱码情况
res.writeHead(200, { 'Content-Type': 'text/plain' });
res.end('欢迎来到Node.js!');
2、解决问题
res.writeHead(200, { 'Content-Type': 'text/plain; charset=utf-8' });
res.writeHead(200, { 'Content-Type': 'text/plain' });
res.end('欢迎来到Node.js!');
res.writeHead(200, { 'Content-Type': 'text/plain; charset=utf-8' });