自己回答了 Laya.Utils.getQueryString 方法的返回值是经过 unescape 解码的数值
我在 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",