nodejs 寫服務器解決中文亂碼問題


nodejs 寫服務器解決中文亂碼問題:https://blog.csdn.net/worldmakewayfordream/article/details/77483423

 

本文鏈接: https://blog.csdn.net/yangshuolll/article/details/77483423

 

 

var http = require('http');
var dt = require('./DateModule')
http.createServer(function(req, res){
res.writeHeader(200, {'Content-Type' : 'text/html;charset:utf-8'
});
res.write('<head><meta charset="utf-8"/></head>');
res.write("The date and time are currently: " + dt.myDateTime());
res.end('Hello world! 你好');
}).listen(8080);


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM