如何在url中停止Meteor.http.get()编码中文字符

时间:2017-04-05 07:17:22

标签: http url meteor get encode

我使用Meteor.http.get()从我的Meteor应用程序中的API获取用户配置文件。有时网址中会有中文字符。举个例子:

Meteor.http.get('https://api.lootbox.eu/pc/us/左手-1241/profile')

但是,由于Meteor.http.get()方法将编码中文字符,因此无法找到用户配置文件。举个例子:

{ statusCode: 404,
     error: 'Found no user with the BattleTag: w%C2%BF%C3%94%C3-1241' } }

如何在网址中停止Meteor.http.get()编码中文字符,以便像"%C2%BF"在url成为正常的汉字?

0 个答案:

没有答案