节点url请求中缺少法语重音字符

时间:2015-08-09 14:53:14

标签: node.js encoding request

我遇到处理请求的问题,其中url包含法语口音。

var url="http://www.babla.ru/dû";

console.log(url); //../dû, here it's OK

var requestOptions  = { encoding: "utf8", method: "GET", uri: url};

request(requestOptions, function (err, resp, body) {
console.log(resp.request.uri.href); //../d, here û is missing!
  ...
 }
});

0 个答案:

没有答案