We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bridge.callHandler('showGoodsSearchResults', {'keyword': '感冒'}, function(response) { })
'感冒' 会在Native会解析成u611Fu5192 ,html端使用的utf-8编码 ,这个问题您怎么看???
The text was updated successfully, but these errors were encountered:
暂时解决了Native获取JS传中文参数乱码问题
把这个实现改了下: webView.evaluateJavascript(script, new ValueCallback() { @OverRide public void onReceiveValue(String value) { if(callback!=null) { if(value != null && value.startsWith(""") && value.endsWith(""")) {
//获取JS 参数,JS中文参数用Unicode编码,这里进行转换 if(value.indexOf("\\u") == value.lastIndexOf("\\u")){ //加6,不解释 String Uvalue= value.substring(value.indexOf("\\u"),value.indexOf("\\u")+6); value = value.replace(Uvalue,decode(Uvalue)); }else{ String Uvalue= value.substring(value.indexOf("\\u"),value.lastIndexOf("\\u")+6); value = value.replace(Uvalue,decode(Uvalue)); } value = value.substring(1,value.length()-1).replaceAll("\\\\", ""); } callback.onReceiveValue(value); } } });
注:decode()方法是把Unicode字符转换成中文String方法
Sorry, something went wrong.
No branches or pull requests
bridge.callHandler('showGoodsSearchResults', {'keyword': '感冒'}, function(response) {
})
'感冒' 会在Native会解析成u611Fu5192
,html端使用的utf-8编码
,这个问题您怎么看???
The text was updated successfully, but these errors were encountered: