[LayaAirIDE 2.0]Laya.Utils.getQueryString 中文乱码
Laya.Utils.getQueryString 中文乱码
调用该方法 获取url参数中的中文乱码如下:
如来 变成了 å¦æ¥
哪位大神知道原因?
调用该方法 获取url参数中的中文乱码如下:
如来 变成了 å¦æ¥
哪位大神知道原因?
没有找到相关结果
已邀请:
要回复问题请先登录
1 个回复
Armed Panda
赞同来自:
我在 launch.json 中"file" 属性中加入了 中文参数如下
"file": "${workspaceRoot}/bin/index.html?mode=1&roomId=1&userName=如来&uid=1&headImg=weiguang/usericon/1.png.jpg&posId=0",
没有经过 escape 编码所以出来是乱码 å¦æ¥
用 console.log(escape("如来")); 方法先编码 然后把编码后的字符串 替换连接参数中的中文 如来 就可以了 如下
"file": "${workspaceRoot}/bin/index.html?mode=1&roomId=1&userName=%u5982%u6765&uid=1&headImg=weiguang/usericon/1.png.jpg&posId=0",