Chinese garbled code on node page

var http = require("http");
http.createServer(function (req,res) {
    res.writeHead(200,{"Content-Type":"text/html,charset=utf-8"});
    res.end("abc","utf-8");
}).listen(8081);

after opening the web page http://localhost:8081/, abc raccoons trickle down to display , why does the response header charset=utf-8 not display properly?

Mar.05,2021

your header information should be set incorrectly:
res.writeHead (200,{ 'Content-Type':'text/html;charset=utf-8'});

in the middle is a semicolon: ; is not a comma

Menu