page = "<!DOCTYPE HTML><html><head><meta http-equiv='Content-Type' content='text/html; charset=utf-8'>" +
"</head><body>" + page + "</body></html>";
webContent.loadData(page, "text/html;charset=UTF-8", "UTF-8");
On the call to loadData the webview gives "URL is invalid", in the onReceivedError callback the url is "data:text/html;charset=UTF-8;UTF-8,%3C!DOCTYPE%20HTML%3E .... /body%3E%3C/html%3E". This doesn't happen on all the data I load.
Note:
Thank you!
webContent.loadDataWithBaseURL(null, page, "text/html", "UTF-8")
works for me, while with loadData() I get sometimes your problem
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With