Node 設置編碼

/**
 * Created with JetBrains WebStorm.
 * User: liangxinglei
 * Date: 14-2-17
 * Time: 上午9:43
 * To change this template use File | Settings | File Templates.
 */
var http = require('http');
var server = http.createServer(function (req, res) {
    res.writeHead(200, {'Content-type': "text/plain;charset=UTF-8"}); // 設置編碼
    res.end("這是個人第一個Node.js程序");
});
server.listen(8000);
相關文章
相關標籤/搜索