android 带有俄语文本格式错误的 webview
android webview with russian text formated erreur
在我的 android 应用程序中,我有一个 webView 但是当我制作这段代码时:
webViewopresentation.loadData("<html><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" /><body> <p><span style=\"color:#FF0000\">Привет, как дела?</span></p> </body></html>", "text/html", "UTF-8");
它向我展示了这段文字。
Привет, как дела?
请问是什么问题?
尝试使用它
webViewopresentation.loadDataWithBaseURL(null, text,"text/html", "UTF-8", null);
我是用资产做的,只需将您的 html 页面保存在资产文件夹中,并带有以下文本
<html> <META HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=utf-8"> <body> <p> <span style = " color: # FF0000 "> Привет, как дела </ span> </ p> </ body> </ html>
然后在您的网络视图(视图)中加载该 html 页面
view.loadUrl("file:///android_asset/newhtml.html");
在我的 android 应用程序中,我有一个 webView 但是当我制作这段代码时:
webViewopresentation.loadData("<html><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" /><body> <p><span style=\"color:#FF0000\">Привет, как дела?</span></p> </body></html>", "text/html", "UTF-8");
它向我展示了这段文字。
Привет, как дела?
请问是什么问题?
尝试使用它
webViewopresentation.loadDataWithBaseURL(null, text,"text/html", "UTF-8", null);
我是用资产做的,只需将您的 html 页面保存在资产文件夹中,并带有以下文本
<html> <META HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=utf-8"> <body> <p> <span style = " color: # FF0000 "> Привет, как дела </ span> </ p> </ body> </ html>
然后在您的网络视图(视图)中加载该 html 页面
view.loadUrl("file:///android_asset/newhtml.html");